mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 04:00:04 +00:00
Address sanitizer options
This commit is contained in:
parent
a88cd27d8b
commit
67f74d9ede
3 changed files with 25 additions and 0 deletions
|
|
@ -41,6 +41,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_ALL_NO_LIB")
|
||||||
set(SCWX_DIR ${PROJECT_SOURCE_DIR})
|
set(SCWX_DIR ${PROJECT_SOURCE_DIR})
|
||||||
set(SCWX_VERSION "0.2.2")
|
set(SCWX_VERSION "0.2.2")
|
||||||
|
|
||||||
|
option(SCWX_ADDRESS_SANITIZER "Build with Address Sanitizer" OFF)
|
||||||
|
|
||||||
add_subdirectory(external)
|
add_subdirectory(external)
|
||||||
add_subdirectory(wxdata)
|
add_subdirectory(wxdata)
|
||||||
add_subdirectory(scwx-qt)
|
add_subdirectory(scwx-qt)
|
||||||
|
|
|
||||||
|
|
@ -399,6 +399,21 @@ target_compile_options(supercell-wx PRIVATE
|
||||||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Werror>
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Werror>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Address Sanitizer options
|
||||||
|
if (SCWX_ADDRESS_SANITIZER)
|
||||||
|
target_compile_options(scwx-qt PRIVATE
|
||||||
|
$<$<CXX_COMPILER_ID:MSVC>:/fsanitize=address>
|
||||||
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-fsanitize=address -fsanitize-recover=address>
|
||||||
|
)
|
||||||
|
target_compile_options(supercell-wx PRIVATE
|
||||||
|
$<$<CXX_COMPILER_ID:MSVC>:/fsanitize=address>
|
||||||
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-fsanitize=address -fsanitize-recover=address>
|
||||||
|
)
|
||||||
|
target_link_options(supercell-wx PRIVATE
|
||||||
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-fsanitize=address>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
# Produce PDB file for debug
|
# Produce PDB file for debug
|
||||||
target_compile_options(scwx-qt PRIVATE "$<$<CONFIG:Release>:/Zi>")
|
target_compile_options(scwx-qt PRIVATE "$<$<CONFIG:Release>:/Zi>")
|
||||||
|
|
|
||||||
|
|
@ -265,3 +265,11 @@ endif()
|
||||||
set_target_properties(wxdata PROPERTIES CXX_STANDARD 20
|
set_target_properties(wxdata PROPERTIES CXX_STANDARD 20
|
||||||
CXX_STANDARD_REQUIRED ON
|
CXX_STANDARD_REQUIRED ON
|
||||||
CXX_EXTENSIONS OFF)
|
CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
# Address Sanitizer options
|
||||||
|
if (SCWX_ADDRESS_SANITIZER)
|
||||||
|
target_compile_options(wxdata PRIVATE
|
||||||
|
$<$<CXX_COMPILER_ID:MSVC>:/fsanitize=address>
|
||||||
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-fsanitize=address -fsanitize-recover=address>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue