summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-08-24 08:06:40 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-08-24 14:05:16 +0300
commit218f31d98c570ec8e8f63d7906754b939fed8f88 (patch)
tree4ee727b6a1bfc37958f815b5155eb5512a12d508
parent0c7ffbf7fd3cbd39d7acd56b566e9a293fad2e56 (diff)
downloadlibatomic_ops-218f31d98c570ec8e8f63d7906754b939fed8f88.tar.gz
Do not use add_definitions in favor of add_compile_definitions (CMake)
(refactoring) According to the CMake manual, add_definitions() has been superseded by alternatives like add_compile_definitions(). * CMakeLists.txt (add_definitions): Replace to add_compile_options; remove quotes. * CMakeLists.txt [enable_assertions] (add_compile_options): Remove quotes.
-rw-r--r--CMakeLists.txt12
1 files changed, 6 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 270011e..af68bd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,28 +97,28 @@ set(THREADDLLIBS_LIST ${CMAKE_THREAD_LIBS_INIT})
if (CMAKE_USE_PTHREADS_INIT)
# Required define if using POSIX threads.
- add_definitions("-D_REENTRANT")
+ add_compile_options(-D_REENTRANT)
else()
# No pthreads library available.
- add_definitions("-DAO_NO_PTHREADS")
+ add_compile_options(-DAO_NO_PTHREADS)
endif()
if (enable_assertions)
# In case NDEBUG macro is defined e.g. by cmake -DCMAKE_BUILD_TYPE=Release.
- add_compile_options("-UNDEBUG")
+ add_compile_options(-UNDEBUG)
else()
# Define to disable assertion checking.
- add_definitions("-DNDEBUG")
+ add_compile_options(-DNDEBUG)
endif()
if (NOT enable_atomic_intrinsics)
# Define to avoid GCC atomic intrinsics even if available.
- add_definitions("-DAO_DISABLE_GCC_ATOMICS")
+ add_compile_options(-DAO_DISABLE_GCC_ATOMICS)
endif()
# AO API symbols export control.
if (BUILD_SHARED_LIBS)
- add_definitions("-DAO_DLL")
+ add_compile_options(-DAO_DLL)
endif()
if (enable_werror)