parent
4000390132
commit
00687fc97c
|
@ -0,0 +1,61 @@
|
||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
set IsTextMode=No
|
||||||
|
|
||||||
|
echo YY-Thunks Installer [Version 0.1.0]
|
||||||
|
echo Copyright (C) Chuyu Team. All rights reserved.
|
||||||
|
echo.
|
||||||
|
|
||||||
|
if /i "%1"=="" goto TextMode
|
||||||
|
if /i "%1"=="/?" goto Help
|
||||||
|
if /i "%1"=="/I" goto Install
|
||||||
|
if /i "%1"=="/U" goto UnInstall
|
||||||
|
|
||||||
|
echo Invaild Command Parameter.
|
||||||
|
echo.
|
||||||
|
goto Help
|
||||||
|
|
||||||
|
:Install
|
||||||
|
echo.
|
||||||
|
echo.Start writing to the registry
|
||||||
|
echo.[HKCU\Code\YY-Thunks]
|
||||||
|
echo.Root="%~dp0"
|
||||||
|
echo.
|
||||||
|
reg ADD HKCU\Code\YY-Thunks /v Root /t REG_SZ /d "%~dp0\" /f
|
||||||
|
echo.
|
||||||
|
goto ExitScript
|
||||||
|
|
||||||
|
:UnInstall
|
||||||
|
echo.
|
||||||
|
reg delete HKCU\Code\YY-Thunks /f
|
||||||
|
echo.
|
||||||
|
goto ExitScript
|
||||||
|
|
||||||
|
:Help
|
||||||
|
echo.Manages YY-Thunks information in the current user registry.
|
||||||
|
echo.
|
||||||
|
echo.Install [Options]
|
||||||
|
echo.
|
||||||
|
echo. /I Add YY-Thunks information to the current user registry.
|
||||||
|
echo. /U Remove YY-Thunks information to the current user registry.
|
||||||
|
echo. /? Show this content.
|
||||||
|
goto ExitScript
|
||||||
|
|
||||||
|
:TextMode
|
||||||
|
set IsTextMode=Yes
|
||||||
|
echo.Welcome to use YY-Thunks Installer! If you want to invoke this script
|
||||||
|
echo.silently, please use /? parameter to read help.
|
||||||
|
reg query HKCU\Code\YY-Thunks /v Root >nul 2>nul && goto TextUnInstall || goto Install
|
||||||
|
|
||||||
|
:TextUnInstall
|
||||||
|
echo.
|
||||||
|
set /p Answer=YY-Thunks appears to be installed, do you want to uninstall it (Y/N)?
|
||||||
|
if /i "%Answer%"=="Y" goto UnInstall
|
||||||
|
echo.
|
||||||
|
echo.Operation canceled.
|
||||||
|
echo.
|
||||||
|
goto ExitScript
|
||||||
|
|
||||||
|
:ExitScript
|
||||||
|
if /i "%IsTextMode%"=="Yes" pause
|
||||||
|
@echo on
|
197
utils.cmake
197
utils.cmake
|
@ -261,7 +261,8 @@ function(setup_project)
|
||||||
enable_language(RC)
|
enable_language(RC)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(CMAKE_RC_FLAGS "/c65001 /DWIN32 /nologo" PARENT_SCOPE)
|
# Clang-CL forces us use "-" instead of "/".
|
||||||
|
set(CMAKE_RC_FLAGS "-c65001 -DWIN32 -nologo" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
@ -378,115 +379,117 @@ function(setup_compile_params)
|
||||||
STRICT # https://learn.microsoft.com/en-us/windows/win32/winprog/enabling-strict
|
STRICT # https://learn.microsoft.com/en-us/windows/win32/winprog/enabling-strict
|
||||||
WIN32_LEAN_AND_MEAN WINRT_LEAN_AND_MEAN # Filter out some rarely used headers, to increase compilation speed.
|
WIN32_LEAN_AND_MEAN WINRT_LEAN_AND_MEAN # Filter out some rarely used headers, to increase compilation speed.
|
||||||
)
|
)
|
||||||
target_compile_options(${__target} PRIVATE
|
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Clang-CL doesn't support all these parameters.
|
||||||
/bigobj /utf-8 $<$<NOT:$<CONFIG:Debug>>:/fp:fast /GT /Gw /Gy /Zc:inline>
|
|
||||||
)
|
|
||||||
target_link_options(${__target} PRIVATE
|
|
||||||
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF /OPT:LBR>
|
|
||||||
/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /WX
|
|
||||||
)
|
|
||||||
set(__target_type "UNKNOWN")
|
|
||||||
get_target_property(__target_type ${__target} TYPE)
|
|
||||||
if(__target_type STREQUAL "EXECUTABLE")
|
|
||||||
target_compile_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/GA>)
|
|
||||||
target_link_options(${__target} PRIVATE /TSAWARE)
|
|
||||||
endif()
|
|
||||||
#if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
|
||||||
# target_link_options(${__target} PRIVATE /SAFESEH)
|
|
||||||
#endif()
|
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
||||||
target_link_options(${__target} PRIVATE /HIGHENTROPYVA)
|
|
||||||
endif()
|
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1915) # Visual Studio 2017 version 15.8
|
|
||||||
target_compile_options(${__target} PRIVATE $<$<CONFIG:Debug,RelWithDebInfo>:/JMC>)
|
|
||||||
endif()
|
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1920) # Visual Studio 2019 version 16.0
|
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
||||||
target_compile_options(${__target} PRIVATE /d2FH4)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1929) # Visual Studio 2019 version 16.10
|
|
||||||
target_compile_options(${__target} PRIVATE /await:strict)
|
|
||||||
elseif(MSVC_VERSION GREATER_EQUAL 1900) # Visual Studio 2015
|
|
||||||
target_compile_options(${__target} PRIVATE /await)
|
|
||||||
endif()
|
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1930) # Visual Studio 2022 version 17.0
|
|
||||||
target_compile_options(${__target} PRIVATE /options:strict)
|
|
||||||
endif()
|
|
||||||
if(COM_ARGS_CFGUARD)
|
|
||||||
target_compile_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:cf>)
|
|
||||||
target_link_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/GUARD:CF>)
|
|
||||||
endif()
|
|
||||||
if(COM_ARGS_INTELCET)
|
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1920) # Visual Studio 2019 version 16.0
|
|
||||||
target_link_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/CETCOMPAT>)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(COM_ARGS_INTELJCC)
|
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1925) # Visual Studio 2019 version 16.5
|
|
||||||
target_compile_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/QIntel-jcc-erratum>)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(COM_ARGS_SPECTRE)
|
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1925) # Visual Studio 2019 version 16.5
|
|
||||||
target_compile_options(${__target} PRIVATE /Qspectre-load)
|
|
||||||
elseif(MSVC_VERSION GREATER_EQUAL 1912) # Visual Studio 2017 version 15.5
|
|
||||||
target_compile_options(${__target} PRIVATE /Qspectre)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(COM_ARGS_EHCONTGUARD)
|
|
||||||
if((MSVC_VERSION GREATER_EQUAL 1927) AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) # Visual Studio 2019 version 16.7
|
|
||||||
target_compile_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:ehcont>)
|
|
||||||
target_link_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:ehcont>)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(COM_ARGS_PERMISSIVE)
|
|
||||||
target_compile_options(${__target} PRIVATE
|
target_compile_options(${__target} PRIVATE
|
||||||
/Zc:auto /Zc:forScope /Zc:implicitNoexcept /Zc:noexceptTypes /Zc:referenceBinding
|
/bigobj /utf-8 $<$<NOT:$<CONFIG:Debug>>:/fp:fast /GT /Gw /Gy /Zc:inline>
|
||||||
/Zc:rvalueCast /Zc:sizedDealloc /Zc:strictStrings /Zc:throwingNew /Zc:trigraphs
|
|
||||||
/Zc:wchar_t
|
|
||||||
)
|
)
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1900) # Visual Studio 2015
|
target_link_options(${__target} PRIVATE
|
||||||
target_compile_options(${__target} PRIVATE /Zc:threadSafeInit)
|
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF /OPT:LBR>
|
||||||
|
/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /WX
|
||||||
|
)
|
||||||
|
set(__target_type "UNKNOWN")
|
||||||
|
get_target_property(__target_type ${__target} TYPE)
|
||||||
|
if(__target_type STREQUAL "EXECUTABLE")
|
||||||
|
target_compile_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/GA>)
|
||||||
|
target_link_options(${__target} PRIVATE /TSAWARE)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1910) # Visual Studio 2017 version 15.0
|
#if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
target_compile_options(${__target} PRIVATE /permissive- /Zc:ternary)
|
# target_link_options(${__target} PRIVATE /SAFESEH)
|
||||||
|
#endif()
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
target_link_options(${__target} PRIVATE /HIGHENTROPYVA)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1912) # Visual Studio 2017 version 15.5
|
if(MSVC_VERSION GREATER_EQUAL 1915) # Visual Studio 2017 version 15.8
|
||||||
target_compile_options(${__target} PRIVATE /Zc:alignedNew)
|
target_compile_options(${__target} PRIVATE $<$<CONFIG:Debug,RelWithDebInfo>:/JMC>)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1913) # Visual Studio 2017 version 15.6
|
if(MSVC_VERSION GREATER_EQUAL 1920) # Visual Studio 2019 version 16.0
|
||||||
target_compile_options(${__target} PRIVATE /Zc:externConstexpr)
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
target_compile_options(${__target} PRIVATE /d2FH4)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1914) # Visual Studio 2017 version 15.7
|
if(MSVC_VERSION GREATER_EQUAL 1929) # Visual Studio 2019 version 16.10
|
||||||
target_compile_options(${__target} PRIVATE /Zc:__cplusplus)
|
target_compile_options(${__target} PRIVATE /await:strict)
|
||||||
|
elseif(MSVC_VERSION GREATER_EQUAL 1900) # Visual Studio 2015
|
||||||
|
target_compile_options(${__target} PRIVATE /await)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1921) # Visual Studio 2019 version 16.1
|
if(MSVC_VERSION GREATER_EQUAL 1930) # Visual Studio 2022 version 17.0
|
||||||
target_compile_options(${__target} PRIVATE /Zc:char8_t)
|
target_compile_options(${__target} PRIVATE /options:strict)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1923) # Visual Studio 2019 version 16.3
|
if(COM_ARGS_CFGUARD)
|
||||||
target_compile_options(${__target} PRIVATE /Zc:externC)
|
target_compile_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:cf>)
|
||||||
|
target_link_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/GUARD:CF>)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1924) # Visual Studio 2019 version 16.4
|
if(COM_ARGS_INTELCET)
|
||||||
target_compile_options(${__target} PRIVATE /Zc:hiddenFriend)
|
if(MSVC_VERSION GREATER_EQUAL 1920) # Visual Studio 2019 version 16.0
|
||||||
|
target_link_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/CETCOMPAT>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1925) # Visual Studio 2019 version 16.5
|
if(COM_ARGS_INTELJCC)
|
||||||
target_compile_options(${__target} PRIVATE /Zc:preprocessor /Zc:tlsGuards)
|
if(MSVC_VERSION GREATER_EQUAL 1925) # Visual Studio 2019 version 16.5
|
||||||
|
target_compile_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/QIntel-jcc-erratum>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1928) # Visual Studio 2019 version 16.8 & 16.9
|
if(COM_ARGS_SPECTRE)
|
||||||
target_compile_options(${__target} PRIVATE /Zc:lambda /Zc:zeroSizeArrayNew)
|
if(MSVC_VERSION GREATER_EQUAL 1925) # Visual Studio 2019 version 16.5
|
||||||
|
target_compile_options(${__target} PRIVATE /Qspectre-load)
|
||||||
|
elseif(MSVC_VERSION GREATER_EQUAL 1912) # Visual Studio 2017 version 15.5
|
||||||
|
target_compile_options(${__target} PRIVATE /Qspectre)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1931) # Visual Studio 2022 version 17.1
|
if(COM_ARGS_EHCONTGUARD)
|
||||||
target_compile_options(${__target} PRIVATE /Zc:static_assert)
|
if((MSVC_VERSION GREATER_EQUAL 1927) AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) # Visual Studio 2019 version 16.7
|
||||||
|
target_compile_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:ehcont>)
|
||||||
|
target_link_options(${__target} PRIVATE $<$<NOT:$<CONFIG:Debug>>:/guard:ehcont>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1932) # Visual Studio 2022 version 17.2
|
if(COM_ARGS_PERMISSIVE)
|
||||||
target_compile_options(${__target} PRIVATE /Zc:__STDC__)
|
target_compile_options(${__target} PRIVATE
|
||||||
endif()
|
/Zc:auto /Zc:forScope /Zc:implicitNoexcept /Zc:noexceptTypes /Zc:referenceBinding
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1934) # Visual Studio 2022 version 17.4
|
/Zc:rvalueCast /Zc:sizedDealloc /Zc:strictStrings /Zc:throwingNew /Zc:trigraphs
|
||||||
target_compile_options(${__target} PRIVATE /Zc:enumTypes /Zc:gotoScope /Zc:nrvo)
|
/Zc:wchar_t
|
||||||
endif()
|
)
|
||||||
if(MSVC_VERSION GREATER_EQUAL 1935) # Visual Studio 2022 version 17.5
|
if(MSVC_VERSION GREATER_EQUAL 1900) # Visual Studio 2015
|
||||||
target_compile_options(${__target} PRIVATE /Zc:templateScope /Zc:checkGwOdr)
|
target_compile_options(${__target} PRIVATE /Zc:threadSafeInit)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1910) # Visual Studio 2017 version 15.0
|
||||||
|
target_compile_options(${__target} PRIVATE /permissive- /Zc:ternary)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1912) # Visual Studio 2017 version 15.5
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:alignedNew)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1913) # Visual Studio 2017 version 15.6
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:externConstexpr)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1914) # Visual Studio 2017 version 15.7
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:__cplusplus)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1921) # Visual Studio 2019 version 16.1
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:char8_t)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1923) # Visual Studio 2019 version 16.3
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:externC)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1924) # Visual Studio 2019 version 16.4
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:hiddenFriend)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1925) # Visual Studio 2019 version 16.5
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:preprocessor /Zc:tlsGuards)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1928) # Visual Studio 2019 version 16.8 & 16.9
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:lambda /Zc:zeroSizeArrayNew)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1931) # Visual Studio 2022 version 17.1
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:static_assert)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1932) # Visual Studio 2022 version 17.2
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:__STDC__)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1934) # Visual Studio 2022 version 17.4
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:enumTypes /Zc:gotoScope /Zc:nrvo)
|
||||||
|
endif()
|
||||||
|
if(MSVC_VERSION GREATER_EQUAL 1935) # Visual Studio 2022 version 17.5
|
||||||
|
target_compile_options(${__target} PRIVATE /Zc:templateScope /Zc:checkGwOdr)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
|
Loading…
Reference in New Issue