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
cf64f2ba
Commit
cf64f2ba
authored
Jun 10, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed CMake address sanitizer
parent
68a0193d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
CMakeLists.txt
CMakeLists.txt
+1
-0
utils.cmake
cmake/utils.cmake
+5
-5
CMakeLists.txt
example/CMakeLists.txt
+2
-2
CMakeLists.txt
tests/CMakeLists.txt
+2
-2
No files found.
CMakeLists.txt
View file @
cf64f2ba
...
@@ -45,6 +45,7 @@ option(SPDLOG_BUILD_EXAMPLES "Build examples" ON)
...
@@ -45,6 +45,7 @@ option(SPDLOG_BUILD_EXAMPLES "Build examples" ON)
option
(
SPDLOG_BUILD_BENCH
"Build benchmarks (Requires https://github.com/google/benchmark.git to be installed)"
OFF
)
option
(
SPDLOG_BUILD_BENCH
"Build benchmarks (Requires https://github.com/google/benchmark.git to be installed)"
OFF
)
option
(
SPDLOG_BUILD_TESTS
"Build tests"
OFF
)
option
(
SPDLOG_BUILD_TESTS
"Build tests"
OFF
)
option
(
SPDLOG_BUILD_HO_TESTS
"Build tests using the header only version"
OFF
)
option
(
SPDLOG_BUILD_HO_TESTS
"Build tests using the header only version"
OFF
)
option
(
SPDLOG_SANITIZE_ADDRESS
"Enable address sanitizer in tests"
OFF
)
option
(
SPDLOG_INSTALL
"Generate the install target."
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_INSTALL
"Generate the install target."
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_FMT_EXTERNAL
"Use external fmt library instead of bundled"
OFF
)
option
(
SPDLOG_FMT_EXTERNAL
"Use external fmt library instead of bundled"
OFF
)
...
...
cmake/utils.cmake
View file @
cf64f2ba
...
@@ -33,9 +33,9 @@ function(spdlog_enable_sanitizer target_name)
...
@@ -33,9 +33,9 @@ function(spdlog_enable_sanitizer target_name)
message
(
FATAL_ERROR
"Sanitizer supported only for gcc/clang"
)
message
(
FATAL_ERROR
"Sanitizer supported only for gcc/clang"
)
endif
()
endif
()
message
(
STATUS
"Address sanitizer enabled"
)
message
(
STATUS
"Address sanitizer enabled"
)
target_compile_options
(
${
target_name
}
"-fsanitize=address,undefined"
)
target_compile_options
(
${
target_name
}
PRIVATE -fsanitize=address,undefined
)
target_compile_options
(
${
target_name
}
"-fno-sanitize=signed-integer-overflow"
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-sanitize=signed-integer-overflow
)
target_compile_options
(
${
target_name
}
"-fno-sanitize-recover=all"
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-sanitize-recover=all
)
target_compile_options
(
${
target_name
}
"-fno-omit-frame-pointer"
)
target_compile_options
(
${
target_name
}
PRIVATE -fno-omit-frame-pointer
)
target_link_libraries
(
${
target_name
}
"-fsanitize=address,undefined -fuse-ld=gold"
)
target_link_libraries
(
${
target_name
}
PRIVATE -fsanitize=address,undefined -fuse-ld=gold
)
endfunction
()
endfunction
()
example/CMakeLists.txt
View file @
cf64f2ba
...
@@ -14,14 +14,14 @@ endif()
...
@@ -14,14 +14,14 @@ endif()
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------
add_executable
(
example example.cpp
)
add_executable
(
example example.cpp
)
spdlog_enable_warnings
(
example
)
spdlog_enable_warnings
(
example
)
target_link_libraries
(
example spdlog::spdlog
)
target_link_libraries
(
example
PRIVATE
spdlog::spdlog
)
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------
# Example of using header-only library
# Example of using header-only library
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------
add_executable
(
example_header_only example.cpp
)
add_executable
(
example_header_only example.cpp
)
spdlog_enable_warnings
(
example_header_only
)
spdlog_enable_warnings
(
example_header_only
)
target_link_libraries
(
example_header_only spdlog::spdlog_header_only
)
target_link_libraries
(
example_header_only
PRIVATE
spdlog::spdlog_header_only
)
# Create logs directory
# Create logs directory
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
tests/CMakeLists.txt
View file @
cf64f2ba
...
@@ -22,7 +22,7 @@ enable_testing()
...
@@ -22,7 +22,7 @@ enable_testing()
if
(
SPDLOG_BUILD_TESTS
)
if
(
SPDLOG_BUILD_TESTS
)
add_executable
(
spdlog-utests
${
SPDLOG_UTESTS_SOURCES
}
)
add_executable
(
spdlog-utests
${
SPDLOG_UTESTS_SOURCES
}
)
spdlog_enable_warnings
(
spdlog-utests
)
spdlog_enable_warnings
(
spdlog-utests
)
target_link_libraries
(
spdlog-utests spdlog
)
target_link_libraries
(
spdlog-utests
PRIVATE
spdlog
)
if
(
SPDLOG_SANITIZE_ADDRESS
)
if
(
SPDLOG_SANITIZE_ADDRESS
)
spdlog_enable_sanitizer
(
spdlog-utests
)
spdlog_enable_sanitizer
(
spdlog-utests
)
endif
()
endif
()
...
@@ -34,7 +34,7 @@ endif()
...
@@ -34,7 +34,7 @@ endif()
if
(
SPDLOG_BUILD_HO_TESTS
)
if
(
SPDLOG_BUILD_HO_TESTS
)
add_executable
(
spdlog-utests-ho
${
SPDLOG_UTESTS_SOURCES
}
)
add_executable
(
spdlog-utests-ho
${
SPDLOG_UTESTS_SOURCES
}
)
spdlog_enable_warnings
(
spdlog-utests-ho
)
spdlog_enable_warnings
(
spdlog-utests-ho
)
target_link_libraries
(
spdlog-utests-ho spdlog::spdlog_header_only
)
target_link_libraries
(
spdlog-utests-ho
PRIVATE
spdlog::spdlog_header_only
)
if
(
SPDLOG_SANITIZE_ADDRESS
)
if
(
SPDLOG_SANITIZE_ADDRESS
)
spdlog_set_address_sanitizer
(
spdlog-utests-ho
)
spdlog_set_address_sanitizer
(
spdlog-utests-ho
)
endif
()
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