From 7ede906e1c93253ebf7fb724fe749ae6cda2ca5c Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 24 Aug 2022 09:13:35 +0300 Subject: Use target_compile_definitions instead of target_compile_options (CMake) (refactoring) * CMakeLists.txt [build_tests] (test_atomic_generalized): Change target_compile_definitions() to target_compile_definitions() and remove "-D" prefix for each defined macro. * CMakeLists.txt [build_tests && CMAKE_USE_PTHREADS_INIT] (test_atomic_pthreads): Likewise. --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af68bd9..773413c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,15 +299,16 @@ if (build_tests) add_test(NAME test_atomic COMMAND test_atomic) add_executable(test_atomic_generalized tests/test_atomic.c) - target_compile_options(test_atomic_generalized - PRIVATE -DAO_PREFER_GENERALIZED -DAO_TEST_EMULATION) + target_compile_definitions(test_atomic_generalized + PRIVATE AO_PREFER_GENERALIZED AO_TEST_EMULATION) target_link_libraries(test_atomic_generalized PRIVATE atomic_ops ${THREADDLLIBS_LIST}) add_test(NAME test_atomic_generalized COMMAND test_atomic_generalized) if (CMAKE_USE_PTHREADS_INIT) add_executable(test_atomic_pthreads tests/test_atomic.c) - target_compile_options(test_atomic_pthreads PRIVATE -DAO_USE_PTHREAD_DEFS) + target_compile_definitions(test_atomic_pthreads + PRIVATE AO_USE_PTHREAD_DEFS) target_link_libraries(test_atomic_pthreads PRIVATE atomic_ops ${THREADDLLIBS_LIST}) add_test(NAME test_atomic_pthreads COMMAND test_atomic_pthreads) -- cgit v1.2.1