Skip to content

Commit

Permalink
Allow specifying a sanitizer with cmake.
Browse files Browse the repository at this point in the history
(cherry-picked from commit 5b94101)
  • Loading branch information
Pentarctagon committed Oct 7, 2018
1 parent 07e6545 commit c75a083
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion utils/travis/docker_run.sh
Expand Up @@ -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=$?
Expand Down

0 comments on commit c75a083

Please sign in to comment.