From b3541af223db0827e5e33eebf6a29154d944a451 Mon Sep 17 00:00:00 2001 From: Angad <66992519+ThirdEyeSqueegee@users.noreply.github.com> Date: Sat, 21 Oct 2023 13:35:56 -0700 Subject: [PATCH] Update template --- CMakeLists.txt | 17 +---------------- CMakePresets.json | 12 +++++------- include/PCH.h | 2 +- vcpkg.json | 4 ++-- 4 files changed, 9 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 840f899..a8cf41c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,21 +13,10 @@ set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF) - -if(CMAKE_BUILD_TYPE STREQUAL Debug) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}") -endif() +set(CMAKE_OPTIMIZE_DEPENDENCIES ON) include(GNUInstallDirs) -message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") -message("CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}") -message("CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @@ -77,10 +66,6 @@ target_include_directories( $ $ ${SIMPLEINI_INCLUDE_DIRS} -) - -target_include_directories( - ${PROJECT_NAME} PUBLIC $ ) diff --git a/CMakePresets.json b/CMakePresets.json index 0f49976..df99771 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -48,11 +48,6 @@ "COMMONLIBSF_COMPILER": "/cgthreads8 /diagnostics:caret /EHsc /fp:contract /fp:except- /guard:cf- /MP /permissive- /sdl /W4 /Zc:__cplusplus /Zc:enumTypes /Zc:lambda /Zc:preprocessor /Zc:referenceBinding /Zc:rvalueCast /Zc:templateScope /Zc:ternary", "COMMONLIBSF_LINKER": "/CGTHREADS:8 /MACHINE:x64 /DEBUG:FULL" }, - "cacheVariables": { - "CMAKE_CXX_FLAGS_RELWITHDEBINFO": "/fp:fast /GR- /Gw /O2 /Ob3 /Qpar", - "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO": "/LTCG:INCREMENTAL /OPT:REF,ICF=4", - "CMAKE_SHARED_LINKER_FLAGS_DEBUG": "/DEBUGTYPE:FIXUP" - }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "intelliSenseMode": "windows-msvc-x64", @@ -64,7 +59,9 @@ "name": "build-release-msvc", "inherits": ["base", "vcpkg", "win32", "x64", "msvc"], "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo" + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_CXX_FLAGS_RELWITHDEBINFO": "/fp:fast /GR- /Gw /O2 /Ob3 /Qpar", + "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO": "/LTCG:INCREMENTAL /OPT:ICF=4" }, "displayName": "Release", "description": "Optimized release build.", @@ -74,7 +71,8 @@ "name": "build-debug-msvc", "inherits": ["base", "vcpkg", "win32", "x64", "msvc"], "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_SHARED_LINKER_FLAGS_DEBUG": "/DEBUGTYPE:FIXUP" }, "displayName": "Debug", "description": "Debug build.", diff --git a/include/PCH.h b/include/PCH.h index f53abb7..3a9f95b 100644 --- a/include/PCH.h +++ b/include/PCH.h @@ -163,7 +163,7 @@ class Singleton constexpr auto operator=(const Singleton&) = delete; constexpr auto operator=(Singleton&&) = delete; - static constexpr T* GetSingleton() noexcept + static constexpr auto GetSingleton() noexcept { static T singleton; return std::addressof(singleton); diff --git a/vcpkg.json b/vcpkg.json index 147f2f5..fa65b36 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,13 +8,13 @@ "default-registry": { "kind": "git", "repository": "https://github.com/microsoft/vcpkg", - "baseline": "486a4640db740f5994e492eb60748111dfc48de7" + "baseline": "830f86fb309ad7167468a433a890b7415fbb90a5" }, "registries": [ { "kind": "git", "repository": "https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg", - "baseline": "55d62818c3b1fe6a06e6059aef1fe2a7006cefc0", + "baseline": "b5564d9a050dccfa4a80334c2f427c4ec8d6c16a", "packages": ["commonlibsf"] } ]