Compare commits

...

3 Commits

Author SHA1 Message Date
Yuhang Zhao 05bb662761 update 2023-06-19 18:03:35 +08:00
Yuhang Zhao 3d3b77f016 update 2023-06-19 17:59:01 +08:00
Yuhang Zhao db8b03ff86 update 2023-06-19 17:47:58 +08:00
3 changed files with 110 additions and 3 deletions

26
setup-proxy.bat Normal file
View File

@ -0,0 +1,26 @@
:: MIT License
::
:: Copyright (C) 2023 by wangwenx190 (Yuhang Zhao)
::
:: Permission is hereby granted, free of charge, to any person obtaining a copy
:: of this software and associated documentation files (the "Software"), to deal
:: in the Software without restriction, including without limitation the rights
:: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
:: copies of the Software, and to permit persons to whom the Software is
:: furnished to do so, subject to the following conditions:
::
:: The above copyright notice and this permission notice shall be included in
:: all copies or substantial portions of the Software.
::
:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
:: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
:: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
:: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
:: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
:: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
:: SOFTWARE.
@echo off
set HTTP_PROXY=http://127.0.0.1:4780
set HTTPS_PROXY=http://127.0.0.1:4780
set ALL_PROXY=http://127.0.0.1:4780

25
setup-proxy.ps1 Normal file
View File

@ -0,0 +1,25 @@
# MIT License
#
# Copyright (C) 2023 by wangwenx190 (Yuhang Zhao)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
$env:HTTP_PROXY="http://127.0.0.1:4780"
$env:HTTPS_PROXY="http://127.0.0.1:4780"
$env:ALL_PROXY="http://127.0.0.1:4780"

View File

@ -35,6 +35,22 @@ function(setup_project)
if(PROJ_ARGS_UNPARSED_ARGUMENTS)
message(AUTHOR_WARNING "setup_project: Unrecognized arguments: ${PROJ_ARGS_UNPARSED_ARGUMENTS}")
endif()
# AUTOMOC include directory is a system include directory by default.
if(POLICY CMP0151)
cmake_policy(SET CMP0151 NEW)
endif()
# Visual Studio Generators select latest Windows SDK by default.
if(POLICY CMP0149)
cmake_policy(SET CMP0149 NEW)
endif()
# Visual Studio Generators build custom commands in parallel.
if(POLICY CMP0147)
cmake_policy(SET CMP0147 NEW)
endif()
# USE_FOLDERS global property is treated as ON by default.
if(POLICY CMP0143)
cmake_policy(SET CMP0143 NEW)
endif()
# MSVC: Do not add "-Z7", "-Zi" or "-ZI" to CMAKE_<LANG>_FLAGS by default. Let developers decide.
if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
@ -43,10 +59,46 @@ function(setup_project)
if(NOT DEFINED CMAKE_MSVC_DEBUG_INFORMATION_FORMAT)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>" PARENT_SCOPE)
endif()
# The if() command supports path comparisons using PATH_EQUAL operator.
if(POLICY CMP0139)
cmake_policy(SET CMP0139 NEW)
endif()
# CheckIPOSupported uses flags from calling project.
if(POLICY CMP0138)
cmake_policy(SET CMP0138 NEW)
endif()
# LINK_LIBRARIES supports the $<LINK_ONLY:...> generator expression.
if(POLICY CMP0131)
cmake_policy(SET CMP0131 NEW)
endif()
# while() diagnoses condition evaluation errors.
if(POLICY CMP0130)
cmake_policy(SET CMP0130 NEW)
endif()
# Improve language standard and extension selection.
if(POLICY CMP0128)
cmake_policy(SET CMP0128 NEW)
endif()
# cmake_dependent_option() supports full Condition Syntax.
if(POLICY CMP0127)
cmake_policy(SET CMP0127 NEW)
endif()
# The set(CACHE) command does not remove any normal variable of the same name from the current scope.
if(POLICY CMP0126)
cmake_policy(SET CMP0126 NEW)
endif()
# find_(path|file|library|program) have consistent behavior for cache variables.
if(POLICY CMP0125)
cmake_policy(SET CMP0125 NEW)
endif()
# foreach() loop variables are only available in the loop scope.
if(POLICY CMP0124)
cmake_policy(SET CMP0124 NEW)
endif()
# The list command detects invalid indices.
if(POLICY CMP0121)
cmake_policy(SET CMP0121 NEW)
endif()
# LANGUAGE source file property explicitly compiles as language.
if(POLICY CMP0119)
cmake_policy(SET CMP0119 NEW)
@ -55,6 +107,10 @@ function(setup_project)
if(POLICY CMP0117)
cmake_policy(SET CMP0117 NEW)
endif()
# Ninja generators transform DEPFILEs from add_custom_command().
if(POLICY CMP0116)
cmake_policy(SET CMP0116 NEW)
endif()
# Source file extensions must be explicit.
if(POLICY CMP0115)
cmake_policy(SET CMP0115 NEW)
@ -153,7 +209,7 @@ function(setup_project)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
if(NOT ("x${CMAKE_C_FLAGS_RELEASE}" STREQUAL "x"))
string(REGEX REPLACE "-O[d|0|1|2|3|fast] " " " CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
string(REGEX REPLACE "[-|/]O[d|0|1|2|3|fast] " " " CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
endif()
endif()
if(PROJ_ARGS_NO_WARNING)
@ -221,7 +277,7 @@ function(setup_project)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(NOT ("x${CMAKE_CXX_FLAGS_RELEASE}" STREQUAL "x"))
string(REGEX REPLACE "-O[d|0|1|2|3|fast] " " " CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
string(REGEX REPLACE "[-|/]O[d|0|1|2|3|fast] " " " CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
endif()
endif()
if(PROJ_ARGS_NO_WARNING)
@ -661,7 +717,7 @@ function(setup_compile_params)
/Zc:dllexportInlines- # Do not export inline member functions. This is similar to "-fvisibility-inlines-hidden".
/Zc:char8_t /Zc:sizedDealloc /Zc:strictStrings /Zc:threadSafeInit /Zc:trigraphs /Zc:twoPhase
/clang:-mcx16 # Needed by _InterlockedCompareExchange128() from CPP/WinRT.
$<$<NOT:$<CONFIG:Debug>>:/clang:-mbranches-within-32B-boundaries /fp:fast /Gw /Gy /Zc:inline>
$<$<NOT:$<CONFIG:Debug>>:/clang:-mbranches-within-32B-boundaries /clang:-ffp-contract=fast /Gw /Gy /Zc:inline>
)
target_link_options(${__target} PRIVATE
--color-diagnostics