Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
49d663f6
Commit
49d663f6
authored
Aug 12, 2018
by
Daniel Chabrowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move tsan/asan flag management to cmake
Add sudo: required to fix asan builds
parent
7e32ccbd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
3 deletions
+33
-3
.travis.yml
.travis.yml
+10
-3
CMakeLists.txt
CMakeLists.txt
+2
-0
sanitizers.cmake
cmake/sanitizers.cmake
+21
-0
No files found.
.travis.yml
View file @
49d663f6
...
...
@@ -2,6 +2,7 @@
# - Louis Dionne's Hana: https://github.com/ldionne/hana
# - Paul Fultz II's FIT: https://github.com/pfultz2/Fit
# - Eric Niebler's range-v3: https://github.com/ericniebler/range-v3
sudo
:
required
language
:
cpp
addons
:
&gcc48
...
...
@@ -96,14 +97,20 @@ before_install:
-
valgrind --version
install
:
-
if [ "$ASAN" == "On" ]; then export CXX_FLAGS="${CXX_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize=signed-integer-overflow -fuse-ld=gold"; fi
-
if [ "$TSAN" == "On" ]; then export CXX_FLAGS="${CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer -fuse-ld=gold"; fi
-
cd ${TRAVIS_BUILD_DIR}
-
mkdir -p build && cd build
-
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_STANDARD=$CPP -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DSPDLOG_BUILD_EXAMPLES=ON --warn-uninitialized
-
|
cmake .. \
--warn-uninitialized \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_CXX_STANDARD=$CPP \
-DSPDLOG_BUILD_EXAMPLES=ON \
-DSPDLOG_SANITIZE_THREAD=$TSAN \
-DSPDLOG_SANITIZE_ADDRESS=$ASAN
-
VERBOSE=1 make -j2
script
:
-
export TSAN_OPTIONS=verbosity=1
-
if [ "$ASAN" != "On" ] && [ "$TSAN" != "On" ]; then CTEST_FLAGS="-DExperimentalMemCheck"; fi
-
ctest -j2 -VV $CTEST_FLAGS
...
...
CMakeLists.txt
View file @
49d663f6
...
...
@@ -20,6 +20,8 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCH
set
(
CMAKE_CXX_FLAGS
"-Wall -O3
${
CMAKE_CXX_FLAGS
}
"
)
endif
()
include
(
cmake/sanitizers.cmake
)
#---------------------------------------------------------------------------------------
# spdlog target
#---------------------------------------------------------------------------------------
...
...
cmake/sanitizers.cmake
0 → 100644
View file @
49d663f6
if
(
SPDLOG_SANITIZE_THREAD AND SPDLOG_SANITIZE_ADDRESS
)
message
(
FATAL_ERROR
"AddressSanitizer is not compatible with ThreadSanitizer."
)
endif
()
if
(
SPDLOG_SANITIZE_ADDRESS
)
message
(
STATUS
"AddressSanitizer enabled"
)
set
(
SANITIZER_FLAGS
"-fsanitize=address,undefined"
)
add_compile_options
(
"-fno-sanitize=signed-integer-overflow"
)
endif
()
if
(
SPDLOG_SANITIZE_THREAD
)
message
(
STATUS
"ThreadSanitizer enabled"
)
set
(
SANITIZER_FLAGS
"-fsanitize=thread"
)
endif
()
if
(
SPDLOG_SANITIZE_THREAD OR SPDLOG_SANITIZE_ADDRESS
)
add_compile_options
(
${
SANITIZER_FLAGS
}
)
add_compile_options
(
"-fno-sanitize-recover=all"
)
add_compile_options
(
"-fno-omit-frame-pointer"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
${
SANITIZER_FLAGS
}
-fuse-ld=gold"
)
endif
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment