Allow specifying a sanitizer with cmake.
(cherry-picked from commit 5b94101975
)
This commit is contained in:
parent
07e654510f
commit
c75a083541
2 changed files with 7 additions and 1 deletions
|
@ -228,6 +228,12 @@ if(ENABLE_PEDANTIC_COMPILATION)
|
|||
|
||||
endif(ENABLE_PEDANTIC_COMPILATION)
|
||||
|
||||
# check for sanitizer options
|
||||
if(SANITIZE)
|
||||
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fsanitize=${SANITIZE}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZE}")
|
||||
endif(SANITIZE)
|
||||
|
||||
### Set the final compiler flags.
|
||||
|
||||
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${CXX_FLAGS_USER}")
|
||||
|
|
|
@ -65,7 +65,7 @@ else
|
|||
echo "compiler_check = content" >> $HOME/.ccache/ccache.conf
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false \
|
||||
-DEXTRA_FLAGS_CONFIG="-pipe" -DOPT="$OPT" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO="$LTO" -DLTO_JOBS=2 -DENABLE_MYSQL=true \
|
||||
-DEXTRA_FLAGS_CONFIG="-pipe" -DOPT="$OPT" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO="$LTO" -DLTO_JOBS=2 -DENABLE_MYSQL=true -DSANITIZE="$SAN" \
|
||||
-DCXX_STD="$CXXSTD" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache && \
|
||||
make VERBOSE=1 -j2
|
||||
BUILD_RET=$?
|
||||
|
|
Loading…
Add table
Reference in a new issue