Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2023-04-01 13:59:19 +08:00
parent 4000390132
commit 00687fc97c
2 changed files with 161 additions and 97 deletions

61
YY-Thunks-Install.bat Normal file
View File

@ -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

View File

@ -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,6 +379,7 @@ 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.
) )
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Clang-CL doesn't support all these parameters.
target_compile_options(${__target} PRIVATE target_compile_options(${__target} PRIVATE
/bigobj /utf-8 $<$<NOT:$<CONFIG:Debug>>:/fp:fast /GT /Gw /Gy /Zc:inline> /bigobj /utf-8 $<$<NOT:$<CONFIG:Debug>>:/fp:fast /GT /Gw /Gy /Zc:inline>
) )
@ -489,6 +491,7 @@ function(setup_compile_params)
target_compile_options(${__target} PRIVATE /Zc:templateScope /Zc:checkGwOdr) target_compile_options(${__target} PRIVATE /Zc:templateScope /Zc:checkGwOdr)
endif() endif()
endif() endif()
endif()
else() else()
# MinGW also support these flags. # MinGW also support these flags.
target_compile_options(${__target} PRIVATE target_compile_options(${__target} PRIVATE