From 218f31d98c570ec8e8f63d7906754b939fed8f88 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 24 Aug 2022 08:06:40 +0300 Subject: 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. --- CMakeLists.txt | 12 ++++++------ 1 file 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) -- cgit v1.2.1