Files
CMake/Tests/RunCMake/Ninja/SourceFileJobPool.cmake
T
Bastien Montagne 3a9d56d2c7 Ninja: Add support for per-source JOB_POOL_COMPILE property
This commit allows to override a global or target-wide 'job pool'
property on a per-source basis.

It modifies the Ninja generator to first look into the source's
properties, and only use the target properties as a fallback.

The new `source` parameter to
`cmNinjaTargetGenerator::addPoolNinjaVariable` may be null, e.g. when
the function is called in context where there is no source (e.g. a
linking task).

Closes: #23994
2025-07-16 21:16:24 +02:00

12 lines
422 B
CMake

set_property(GLOBAL PROPERTY JOB_POOLS source_file_compile_pool=2 target_compile_pool=4 target_link_pool=1)
enable_language(C)
set_property(SOURCE hello.c PROPERTY JOB_POOL_COMPILE "source_file_compile_pool")
add_executable(hello hello.c)
set_property(TARGET hello PROPERTY JOB_POOL_COMPILE "target_compile_pool")
set_property(TARGET hello PROPERTY JOB_POOL_LINK "target_link_pool")
include(CheckNoPrefixSubDir.cmake)