msvc: allow disable permissive checks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
32457c5538
commit
f651116fda
|
@ -40,6 +40,7 @@ option(FRAMELESSHELPER_NO_DEBUG_OUTPUT "Suppress the debug messages from Framele
|
|||
option(FRAMELESSHELPER_NO_BUNDLE_RESOURCE "Do not bundle any resources within FramelessHelper." OFF)
|
||||
option(FRAMELESSHELPER_NO_PRIVATE "Do not use any private functionalities from Qt." OFF)
|
||||
option(FRAMELESSHELPER_ENABLE_VCLTL "MSVC only: link to the system MSVCRT/UCRT and get rid of API sets." OFF)
|
||||
option(FRAMELESSHELPER_NO_PERMISSIVE_CHECKS "MSVC only: disable the additional permissive checks." OFF)
|
||||
|
||||
if(FRAMELESSHELPER_NO_BUNDLE_RESOURCE)
|
||||
message(WARNING "Nothing will be embeded into FramelessHelper, the chrome buttons will have no icon.")
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<!--
|
||||
MIT License
|
||||
|
||||
|
@ -22,7 +24,6 @@
|
|||
SOFTWARE.
|
||||
-->
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity type="win32" name="org.wangwenx190.framelesshelper.demo" version="1.0.0.0"/>
|
||||
<description>FramelessHelper Demo</description>
|
||||
|
|
|
@ -67,9 +67,6 @@ function(setup_compile_params arg_target)
|
|||
)
|
||||
target_compile_options(${arg_target} PRIVATE
|
||||
/bigobj /utf-8 $<$<NOT:$<CONFIG:Debug>>:/fp:fast /GT /Gw /Gy /guard:cf /Zc:inline>
|
||||
/Zc:auto /Zc:forScope /Zc:implicitNoexcept /Zc:noexceptTypes /Zc:referenceBinding
|
||||
/Zc:rvalueCast /Zc:sizedDealloc /Zc:strictStrings /Zc:throwingNew /Zc:trigraphs
|
||||
/Zc:wchar_t
|
||||
)
|
||||
target_link_options(${arg_target} PRIVATE
|
||||
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF /OPT:LBR /GUARD:CF>
|
||||
|
@ -87,6 +84,38 @@ function(setup_compile_params arg_target)
|
|||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
target_link_options(${arg_target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/HIGHENTROPYVA>)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1915) # Visual Studio 2017 version 15.8
|
||||
target_compile_options(${arg_target} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:/JMC>)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1920) # Visual Studio 2019 version 16.0
|
||||
target_link_options(${arg_target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/CETCOMPAT>)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
target_compile_options(${arg_target} PRIVATE /d2FH4)
|
||||
endif()
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1925) # Visual Studio 2019 version 16.5
|
||||
target_compile_options(${arg_target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/QIntel-jcc-erratum>) # /Qspectre-load
|
||||
#elseif(MSVC_VERSION GREATER_EQUAL 1912) # Visual Studio 2017 version 15.5
|
||||
# target_compile_options(${arg_target} PRIVATE /Qspectre)
|
||||
endif()
|
||||
#if((MSVC_VERSION GREATER_EQUAL 1927) AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) # Visual Studio 2019 version 16.7
|
||||
# target_compile_options(${arg_target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:ehcont>)
|
||||
# target_link_options(${arg_target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:ehcont>)
|
||||
#endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1929) # Visual Studio 2019 version 16.10
|
||||
target_compile_options(${arg_target} PRIVATE /await:strict)
|
||||
elseif(MSVC_VERSION GREATER_EQUAL 1900) # Visual Studio 2015
|
||||
target_compile_options(${arg_target} PRIVATE /await)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1930) # Visual Studio 2022 version 17.0
|
||||
target_compile_options(${arg_target} PRIVATE /options:strict)
|
||||
endif()
|
||||
if(NOT FRAMELESSHELPER_NO_PERMISSIVE_CHECKS)
|
||||
target_compile_options(${arg_target} PRIVATE
|
||||
/Zc:auto /Zc:forScope /Zc:implicitNoexcept /Zc:noexceptTypes /Zc:referenceBinding
|
||||
/Zc:rvalueCast /Zc:sizedDealloc /Zc:strictStrings /Zc:throwingNew /Zc:trigraphs
|
||||
/Zc:wchar_t
|
||||
)
|
||||
if(MSVC_VERSION GREATER_EQUAL 1900) # Visual Studio 2015
|
||||
target_compile_options(${arg_target} PRIVATE /Zc:threadSafeInit)
|
||||
endif()
|
||||
|
@ -102,15 +131,6 @@ function(setup_compile_params arg_target)
|
|||
if(MSVC_VERSION GREATER_EQUAL 1914) # Visual Studio 2017 version 15.7
|
||||
target_compile_options(${arg_target} PRIVATE /Zc:__cplusplus)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1915) # Visual Studio 2017 version 15.8
|
||||
target_compile_options(${arg_target} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:/JMC>)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1920) # Visual Studio 2019 version 16.0
|
||||
target_link_options(${arg_target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/CETCOMPAT>)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
target_compile_options(${arg_target} PRIVATE /d2FH4)
|
||||
endif()
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1921) # Visual Studio 2019 version 16.1
|
||||
target_compile_options(${arg_target} PRIVATE /Zc:char8_t)
|
||||
endif()
|
||||
|
@ -121,27 +141,11 @@ function(setup_compile_params arg_target)
|
|||
target_compile_options(${arg_target} PRIVATE /Zc:hiddenFriend)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1925) # Visual Studio 2019 version 16.5
|
||||
target_compile_options(${arg_target} PRIVATE
|
||||
/Zc:preprocessor /Zc:tlsGuards $<$<NOT:$<CONFIG:Debug>>:/QIntel-jcc-erratum> # /Qspectre-load
|
||||
)
|
||||
#elseif(MSVC_VERSION GREATER_EQUAL 1912) # Visual Studio 2017 version 15.5
|
||||
# target_compile_options(${arg_target} PRIVATE /Qspectre)
|
||||
target_compile_options(${arg_target} PRIVATE /Zc:preprocessor /Zc:tlsGuards)
|
||||
endif()
|
||||
#[[if((MSVC_VERSION GREATER_EQUAL 1927) AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) # Visual Studio 2019 version 16.7
|
||||
target_compile_options(${arg_target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:ehcont>)
|
||||
target_link_options(${arg_target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:ehcont>)
|
||||
endif()]]
|
||||
if(MSVC_VERSION GREATER_EQUAL 1928) # Visual Studio 2019 version 16.8 & 16.9
|
||||
target_compile_options(${arg_target} PRIVATE /Zc:lambda /Zc:zeroSizeArrayNew)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1929) # Visual Studio 2019 version 16.10
|
||||
target_compile_options(${arg_target} PRIVATE /await:strict)
|
||||
elseif(MSVC_VERSION GREATER_EQUAL 1900) # Visual Studio 2015
|
||||
target_compile_options(${arg_target} PRIVATE /await)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1930) # Visual Studio 2022 version 17.0
|
||||
target_compile_options(${arg_target} PRIVATE /options:strict)
|
||||
endif()
|
||||
if(MSVC_VERSION GREATER_EQUAL 1931) # Visual Studio 2022 version 17.1
|
||||
target_compile_options(${arg_target} PRIVATE /Zc:static_assert)
|
||||
endif()
|
||||
|
@ -154,6 +158,7 @@ function(setup_compile_params arg_target)
|
|||
if(MSVC_VERSION GREATER_EQUAL 1935) # Visual Studio 2022 version 17.5
|
||||
target_compile_options(${arg_target} PRIVATE /Zc:templateScope /Zc:checkGwOdr)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
target_compile_options(${arg_target} PRIVATE
|
||||
-Wall -Wextra -Werror
|
||||
|
|
Loading…
Reference in New Issue