Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
58629f1f
Unverified
Commit
58629f1f
authored
Apr 03, 2020
by
Gabi Melman
Committed by
GitHub
Apr 03, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1503 from Glamhoth/warnings_as_option
Added an option to disable compiler warnings
parents
c2b47430
132ec0a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
CMakeLists.txt
CMakeLists.txt
+3
-0
cmake/utils.cmake
cmake/utils.cmake
+13
-11
No files found.
CMakeLists.txt
View file @
58629f1f
...
@@ -79,6 +79,9 @@ option(SPDLOG_BUILD_BENCH "Build benchmarks (Requires https://github.com/google/
...
@@ -79,6 +79,9 @@ option(SPDLOG_BUILD_BENCH "Build benchmarks (Requires https://github.com/google/
# sanitizer options
# sanitizer options
option
(
SPDLOG_SANITIZE_ADDRESS
"Enable address sanitizer in tests"
OFF
)
option
(
SPDLOG_SANITIZE_ADDRESS
"Enable address sanitizer in tests"
OFF
)
# warning options
option
(
SPDLOG_ENABLE_WARNINGS
"Enable compiler warnings"
ON
)
# install options
# install options
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 @
58629f1f
...
@@ -28,17 +28,19 @@ endfunction()
...
@@ -28,17 +28,19 @@ endfunction()
# Turn on warnings on the given target
# Turn on warnings on the given target
function
(
spdlog_enable_warnings target_name
)
function
(
spdlog_enable_warnings target_name
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
)
if
(
SPDLOG_ENABLE_WARNINGS
)
list
(
APPEND MSVC_OPTIONS
"/W3"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
)
if
(
MSVC_VERSION GREATER 1900
)
#Allow non fatal security wanrnings for msvc 2015
list
(
APPEND MSVC_OPTIONS
"/W3"
)
list
(
APPEND MSVC_OPTIONS
"/WX"
)
if
(
MSVC_VERSION GREATER 1900
)
#Allow non fatal security wanrnings for msvc 2015
endif
()
list
(
APPEND MSVC_OPTIONS
"/WX"
)
endif
()
endif
()
endif
()
target_compile_options
(
${
target_name
}
PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
target_compile_options
(
${
target_name
}
PRIVATE
-Wall -Wextra -Wconversion -pedantic -Wfatal-errors>
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
$<$<CXX_COMPILER_ID:MSVC>:
${
MSVC_OPTIONS
}
>
)
-Wall -Wextra -Wconversion -pedantic -Wfatal-errors>
$<$<CXX_COMPILER_ID:MSVC>:
${
MSVC_OPTIONS
}
>
)
endif
()
endfunction
()
endfunction
()
...
...
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