mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 08:25:43 +08:00
create MSVC_OPTIONS list only if compiler is msvc
This commit is contained in:
parent
7054cf7a35
commit
3e4df86ac0
@ -28,10 +28,13 @@ 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)
|
||||||
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
|
||||||
|
list(APPEND MSVC_OPTIONS "/WX")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_options(${target_name} PRIVATE
|
target_compile_options(${target_name} PRIVATE
|
||||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
|
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
|
||||||
-Wall -Wextra -Wconversion -pedantic -Wfatal-errors>
|
-Wall -Wextra -Wconversion -pedantic -Wfatal-errors>
|
||||||
|
Loading…
Reference in New Issue
Block a user