Skip to content

Commit

Permalink
NO_STATIC_LIBASAN replaced with option. pcm.spec fixed: #794
Browse files Browse the repository at this point in the history
  • Loading branch information
Artiom N. authored and opcm committed Jul 30, 2024
1 parent 3bd9509 commit 33111e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion pcm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -72,15 +72,15 @@ 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 "")
else()
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()

Expand Down

0 comments on commit 33111e4

Please sign in to comment.