This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/CMakeLists.txt b/CMakeLists.txt | |
index a082038..f4455c0 100644 | |
--- a/CMakeLists.txt | |
+++ b/CMakeLists.txt | |
@@ -124,7 +124,7 @@ include_directories(${YAML_CPP_SOURCE_DIR}/include) | |
### General compilation settings | |
### | |
set(yaml_c_flags ${CMAKE_C_FLAGS}) | |
-set(yaml_cxx_flags ${CMAKE_CXX_FLAGS}) | |
+set(yaml_cxx_flags "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer") | |
if(BUILD_SHARED_LIBS) | |
set(LABEL_SUFFIX "shared") | |
@@ -282,6 +282,7 @@ set(_INSTALL_DESTINATIONS | |
add_library(yaml-cpp ${library_sources}) | |
set_target_properties(yaml-cpp PROPERTIES | |
COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags}" | |
+ LINK_FLAGS "-fsanitize=address -fno-omit-frame-pointer" | |
) | |
set_target_properties(yaml-cpp PROPERTIES | |
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt | |
index 74455a5..4f90dce 100644 | |
--- a/test/CMakeLists.txt | |
+++ b/test/CMakeLists.txt | |
@@ -34,6 +34,7 @@ add_executable(run-tests | |
) | |
set_target_properties(run-tests PROPERTIES | |
COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags} ${yaml_test_flags}" | |
+ LINK_FLAGS "-fsanitize=address -fno-omit-frame-pointer" | |
) | |
target_link_libraries(run-tests yaml-cpp gmock) | |
diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt | |
index 2286627..986d2c3 100644 | |
--- a/util/CMakeLists.txt | |
+++ b/util/CMakeLists.txt | |
@@ -1,14 +1,14 @@ | |
add_sources(parse.cpp) | |
add_executable(parse parse.cpp) | |
target_link_libraries(parse yaml-cpp) | |
-set_target_properties(parse PROPERTIES COMPILE_FLAGS "-std=c++11") | |
+set_target_properties(parse PROPERTIES COMPILE_FLAGS "-std=c++11" LINK_FLAGS "-fsanitize=address -fno-omit-frame-pointer") | |
add_sources(sandbox.cpp) | |
add_executable(sandbox sandbox.cpp) | |
target_link_libraries(sandbox yaml-cpp) | |
-set_target_properties(sandbox PROPERTIES COMPILE_FLAGS "-std=c++11") | |
+set_target_properties(sandbox PROPERTIES COMPILE_FLAGS "-std=c++11" LINK_FLAGS "-fsanitize=address -fno-omit-frame-pointer") | |
add_sources(read.cpp) | |
add_executable(read read.cpp) | |
target_link_libraries(read yaml-cpp) | |
-set_target_properties(read PROPERTIES COMPILE_FLAGS "-std=c++11") | |
+set_target_properties(read PROPERTIES COMPILE_FLAGS "-std=c++11" LINK_FLAGS "-fsanitize=address -fno-omit-frame-pointer") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment