Files
CMake/Tests/RunCMake/ExternalProject/GNUMakeJobServerAware-check.cmake
Chris Mahoney bc43398e72 ExternalProject: Enable Make Job Server with Explicit Build Command
Introduces `BUILD_JOB_SERVER_AWARE` option to `ExternalProject_Add` and
`JOB_SERVER_AWARE` to `ExternalProject_Add_Step`. When using an explicit
`BUILD_COMMAND` or `COMMAND`, the generated commands won't use `$(MAKE)`
thus failing to connect to the outer make's job server. These new
options enable explicit job server integration.

Co-authored-by: Brad King <brad.king@kitware.com>

Fixes: #16273
2023-08-15 12:21:30 +00:00

17 lines
564 B
CMake

set(BUILD_DIR "${RunCMake_BINARY_DIR}/GNUMakeJobServerAware-build")
function(check target regex)
file(STRINGS ${BUILD_DIR}/${target} lines
REGEX ${regex}
)
list(LENGTH lines len)
if(len EQUAL 0)
message(FATAL_ERROR "Could not find matching lines '${regex}' in ${BUILD_DIR}/${target}")
endif()
endfunction()
check("/CMakeFiles/Foo.dir/build.make" [[\+cd (/d )?"?.*"? && "?.*"? --build "?.*"?]])
check("/CMakeFiles/Foo.dir/build.make" [[\+cd (/d )?"?.*"? && "?.*"? -E touch "?.*"?]])
check("/CMakeFiles/Foo.dir/build.make" [[\+"?.*"? -E true]])