diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-08-24 09:13:35 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-08-24 14:06:34 +0300 |
commit | 7ede906e1c93253ebf7fb724fe749ae6cda2ca5c (patch) | |
tree | 18e0d633da3c8ea0cd271739411c12c690547257 | |
parent | 218f31d98c570ec8e8f63d7906754b939fed8f88 (diff) | |
download | libatomic_ops-7ede906e1c93253ebf7fb724fe749ae6cda2ca5c.tar.gz |
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.
-rw-r--r-- | CMakeLists.txt | 7 |
1 files 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) |