Skip to content

build: Added Makefile#19

Open
Katulos wants to merge 1 commit intoCryptoPro:mainfrom
Katulos:main
Open

build: Added Makefile#19
Katulos wants to merge 1 commit intoCryptoPro:mainfrom
Katulos:main

Conversation

@Katulos
Copy link
Copy Markdown
Contributor

@Katulos Katulos commented Apr 1, 2026

No description provided.

.PHONY: build-library
build-library: clean ## Build shared library
cmake -S . -B build
cmake --build build -j$(nproc) No newline at end of file
Copy link
Copy Markdown
Collaborator

@cpsdenis cpsdenis Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-j$(nproc) разворачивается в -j при запуске из make. Такой вызов синтаксически корректен, но make -j печально известен тем, что приводит к перегрузкам системы (и ошибкам сборки в достаточно больших проектах).
Предлагается заменить на cmake --build build -j$$(nproc)

Copy link
Copy Markdown
Contributor Author

@Katulos Katulos Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну в таком случае можно просто заменить на cmake --build build --parallel. Это устроит?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Некоторые LLM ошибочно утверждают, что вызов cmake --build build --parallel равносилен вызову cmake --build build -j$(nproc). Согласно документации, такой вызов просто перевызывает нативную сборочную утилиту с теми же параметрами (в нашем случае make -j):

The cmake(1) Build a Project (cmake --build) gained --parallel [<jobs>] and -j [<jobs>] options to specify a parallel build level. They map to corresponding options of the native build tool.

https://cmake.org/cmake/help/latest/release/3.12.html#id4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants