Last active
November 12, 2020 16:23
-
-
Save 1ncend1ary/1b5840498a072d747a98da2f5475d665 to your computer and use it in GitHub Desktop.
Minimal CMakeLists.txt for C++ sanitizer debug
This file contains hidden or 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
cmake_minimum_required(VERSION 3.8) | |
project(clw-05) | |
set(CMAKE_CXX_STANDARD 17) | |
#set(ENV{ASAN_OPTIONS} detect_leaks=1) | |
#set(ENV{ASAN_OPTIONS=detect_leaks} "1") | |
if (MSVC) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") # CMake already contains W3 in its flags | |
else () | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 \ | |
-Wall -Wextra -Werror \ | |
-O0 -g -fsanitize=address -fno-omit-frame-pointer") | |
endif () | |
# Uncomment to work on task 1, shared_buffer | |
add_executable(shared_buffer_test src/task_1/shared_buffer.cpp src/task_1/test_shared_buffer.cpp) | |
# Uncomment to work on task 1, lazy_string | |
#add_executable(lazy_string_test src/task_1/shared_buffer.cpp src/task_1/lazy_string.cpp src/task_1/test_lazy_string.cpp) | |
# Uncomment to work on task 1, lazy_string_access_op | |
# add_executable(lazy_string_access_op_test src/task_1/shared_buffer.cpp src/task_1/lazy_string.cpp src/task_1/test_access_operator.cpp) | |
# Uncomment to work on task 2 | |
# add_executable(read_write_test src/task_2/read_write.cpp src/task_2/test.cpp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment