From 26be4b51b7762a6246c0bd9188d7ac88abade030 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 11 Jul 2022 00:33:55 +0200 Subject: [PATCH] Survive with old cmakes --- CMakeLists.txt | 1 + examples/sthread/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b03c59570a..d39d92ad58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ cmake_minimum_required(VERSION 3.5) if(NOT CMAKE_VERSION VERSION_LESS "3.9") cmake_policy(SET CMP0069 NEW) endif() +# once we move >= 3.13, we should use target_link_option in examples/sthread message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/tools/cmake/Modules) diff --git a/examples/sthread/CMakeLists.txt b/examples/sthread/CMakeLists.txt index 6a91932067..81d4ef1dea 100644 --- a/examples/sthread/CMakeLists.txt +++ b/examples/sthread/CMakeLists.txt @@ -11,7 +11,7 @@ foreach(x add_executable (pthread-${x} EXCLUDE_FROM_ALL pthread-${x}.c) set_target_properties(pthread-${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(pthread-${x} PRIVATE Threads::Threads) - target_link_options(pthread-${x} PUBLIC "-Wl,-znorelro -Wl,-znoseparate-code") + target_link_libraries(pthread-${x} PUBLIC "-Wl,-znorelro -Wl,-znoseparate-code") # TODO: convert to target_link_option once cmake is >3.13 add_dependencies(tests pthread-${x}) ADD_TESH_FACTORIES(pthread-${x} "^thread" --setenv libdir=${CMAKE_BINARY_DIR}/lib --cd ${CMAKE_BINARY_DIR}/examples/sthread ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.tesh) -- 2.20.1