Skip to content

Commit c498779

Browse files
Merge #1687: cmake: support the use of launchers in ctest -S scripts
0dfe387 cmake: support the use of launchers in ctest -S scripts (Daniel Pfeifer) Pull request description: When `CTEST_USE_LAUNCHERS` is set to `ON` in a `ctest -S` script, the configure step fails with the error message: ``` CMake Error: CTEST_USE_LAUNCHERS is enabled, but the RULE_LAUNCH_COMPILE global property is not defined. Did you forget to include(CTest) in the toplevel CMakeLists.txt ? ``` However, `include(CTest)` produces unwanted clutter. `include(CTestUseLaunchers)` is a more lightweight alternative. To reproduce the issue, run the following script with and without the PR applied. ```cmake #!/usr/bin/env -S ctest -VV -S set(CTEST_SOURCE_DIRECTORY "/path/to/secp256k1") set(CTEST_BINARY_DIRECTORY "/path/to/secp256k1-build") set(CTEST_CMAKE_GENERATOR "Ninja") set(CTEST_USE_LAUNCHERS ON) ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) ctest_start("Experimental") ctest_configure() ctest_build() ``` ACKs for top commit: hebasto: ACK 0dfe387. Tree-SHA512: 643d0fabd19ddfd5a64a0b34cfcca8ea2cff64438ee3441ba9a1745618daf99c468ec201ea6992c542d4e33152f4833691c42c8a90301fe3dfc3f0f49f755e55
2 parents 89096c2 + 0dfe387 commit c498779

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ project(libsecp256k1
1313
LANGUAGES C
1414
)
1515
enable_testing()
16+
include(CTestUseLaunchers) # Allow users to set CTEST_USE_LAUNCHERS in custom `ctest -S` scripts.
1617
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
1718

1819
# The library version is based on libtool versioning of the ABI. The set of

0 commit comments

Comments
 (0)