From 01f2566c98fd6d7bc00dff6cf72572a42d35173c Mon Sep 17 00:00:00 2001 From: "Artiom N." Date: Tue, 30 Jul 2024 12:59:29 +0300 Subject: [PATCH] NO_STATIC_LIBASAN replaced with option. pcm.spec fixed: #794 --- CMakeLists.txt | 3 ++- pcm.spec | 2 +- src/CMakeLists.txt | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a326a261..37845378 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,12 +13,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) option(PCM_NO_ASAN "Disable address sanitizer" OFF) option(PCM_FUZZ "Enable fuzzing" OFF) option(PCM_BUILD_EXECUTABLES "Build PCM utilities" ON) +option(PCM_NO_STATIC_LIBASAN OFF) if(MSVC) option(PCM_NO_STATIC_MSVC_RUNTIME_LIBRARY "Disable using static runtime under MSVC" OFF) endif() -foreach(opt NO_STATIC_MSVC_RUNTIME_LIBRARY;FUZZ;NO_ASAN) +foreach(opt NO_STATIC_MSVC_RUNTIME_LIBRARY;FUZZ;NO_ASAN;NO_STATIC_LIBASAN) if(${opt}) message(DEPRECATION "Option \"${opt}\" is deprecated and will be removed soon. Please use \"PCM_${opt}\"") set(PCM_${opt} ${opt}) diff --git a/pcm.spec b/pcm.spec index 803d4e9b..c75d4f90 100644 --- a/pcm.spec +++ b/pcm.spec @@ -32,7 +32,7 @@ Intel(r) Performance Counter Monitor (Intel(r) PCM) is an application programmin %build mkdir build cd build -cmake -DNO_STATIC_LIBASAN=1 -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_BUILD_TYPE=RelWithDebInfo .. +cmake -DPCM_NO_STATIC_LIBASAN=ON -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_BUILD_TYPE=RelWithDebInfo .. make -j %install diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2b8a50cf..2e0b7fe2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,9 +30,9 @@ if (LINUX) endif() endif() -if(NOT DEFINED NO_ASAN) +if(NOT PCM_NO_ASAN) if(OS_ID STREQUAL "centos") - set(NO_STATIC_LIBASAN 1) + set(PCM_NO_STATIC_LIBASAN ON) message(STATUS "CentOS detected, using dynamic libasan") endif() endif() @@ -72,7 +72,7 @@ if(UNIX) # LINUX, FREE_BSD, APPLE set(PCM_DYNAMIC_ASAN "") set(PCM_STATIC_ASAN "") else() - if(NO_STATIC_LIBASAN) + if(PCM_NO_STATIC_LIBASAN) message(STATUS "Using dynamic libasan") set(PCM_DYNAMIC_ASAN "asan") set(PCM_STATIC_ASAN "") @@ -80,7 +80,7 @@ if(UNIX) # LINUX, FREE_BSD, APPLE set(PCM_DYNAMIC_ASAN "") set(PCM_STATIC_ASAN "-static-libasan") message(STATUS "Using static libasan") - message(STATUS "To use dynamic libasan, use -DNO_STATIC_LIBASAN=1 option (required for CentOS)") + message(STATUS "To use dynamic libasan, use -DPCM_NO_STATIC_LIBASAN=1 option (required for CentOS)") endif() endif()