@@ -87,6 +87,10 @@ set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;")
87
87
set (LLVM_USE_CRT_DEBUG MTd CACHE STRING "Nabla developer note: No idea what subfolder provides this" )
88
88
set (LLVM_USE_CRT_RELEASE MT CACHE STRING "Nabla developer note: No idea what subfolder provides this" )
89
89
90
+ unset (CMAKE_CXX_FLAGS_DEBUG CACHE )
91
+ unset (CMAKE_CXX_FLAGS_DEBUG )
92
+ #set(CMAKE_CXX_FLAGS_DEBUG /Zi /Ob0 /Od /MTd)
93
+
90
94
if (NOT CMAKE_BUILD_TYPE )
91
95
set (CMAKE_BUILD_TYPE Debug CACHE STRING "Build type: Debug or Release" FORCE )
92
96
endif ()
@@ -100,6 +104,14 @@ endif()
100
104
macro (nbl_adjust_flags )
101
105
option (NBL_SANITIZE_ADDRESS OFF )
102
106
107
+ # test
108
+ add_compile_options ("/fsanitize=adress" )
109
+ add_compile_options ("-fsanitize=adress" )
110
+ #add_link_options("/fsanitize=address")
111
+
112
+ # TODO: AnastaZIuk please clean it later or somebody
113
+ #message(FATAL_ERROR "${CMAKE_CXX_FLAGS_DEBUG}")
114
+
103
115
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
104
116
option (NBL_SANITIZE_THREAD OFF )
105
117
endif ()
@@ -185,9 +197,9 @@ macro(nbl_adjust_flags)
185
197
elseif (MSVC ) # /arch:sse3 or anything like this is not needed on x64 on MSVC for enabling sse3 instructions
186
198
if (NBL_SANITIZE_ADDRESS )
187
199
set (NBL_MSVC_FLAG_SANITIZE_ADDRESS "/fsanitize=address" )
188
- message (WARNING "Due to https://github.com/google/sanitizers/issues/328 expect not to be able to use the Debug target!" )
189
- set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /wholearchive:clang_rt.asan_dbg-x86_64.lib /wholearchive:clang_rt.asan_cxx_dbg-x86_64.lib" )
190
- set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /wholearchive:clang_rt.asan-x86_64.lib /wholearchive:clang_rt.asan_cxx-x86_64.lib" )
200
+ # message(WARNING "Due to https://github.com/google/sanitizers/issues/328 expect not to be able to use the Debug target!")
201
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /wholearchive:clang_rt.asan_dbg-x86_64.lib /wholearchive:clang_rt.asan_cxx_dbg-x86_64.lib -fno-omit-frame-pointer -fsanitize=address " )
202
+ set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /wholearchive:clang_rt.asan-x86_64.lib /wholearchive:clang_rt.asan_cxx-x86_64.lib -fno-omit-frame-pointer -fsanitize=address " )
191
203
endif ()
192
204
193
205
# debug
0 commit comments