mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
Merge pull request #1495 from trondhe/v1.x
add /WX mscv compiler option for only mscv compiler
This commit is contained in:
commit
1ccdc225af
@ -28,13 +28,18 @@ 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")
|
||||||
|
list(APPEND MSVC_OPTIONS "/W3")
|
||||||
|
if(MSVC_VERSION GREATER 1900) #Allow non fatal security wanrnings for msvc 2015
|
||||||
|
list(APPEND MSVC_OPTIONS "/WX")
|
||||||
|
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>
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:/W3>)
|
$<$<CXX_COMPILER_ID:MSVC>:${MSVC_OPTIONS}>)
|
||||||
if(MSVC_VERSION GREATER 1900) #Allow non fatal security wanrnings for msvc 2015
|
|
||||||
target_compile_options(${target_name} PRIVATE /WX)
|
|
||||||
endif()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user