Skip to content

Commit

Permalink
build: simplify adding compile and link options
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Oct 29, 2023
1 parent 22aafe9 commit 25193bd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${PROJECT_SOURCE_DIR}")

if (ENABLE_ASAN)
set(asan_cflags "-fsanitize=address -fno-omit-frame-pointer")
set(asan_lflags "-fsanitize=address -lasan")
set(CMAKE_C_FLAGS "${asan_cflags} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${asan_cflags} ${CMAKE_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${asan_lflags} ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${asan_lflags} ${CMAKE_SHARED_LINKER_FLAGS}")
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
add_link_options(-fsanitize=address -lasan)
endif()

set(Boost_USE_STATIC_LIBS ${WITH_STATIC_DEPS})
Expand Down

0 comments on commit 25193bd

Please sign in to comment.