From 1d41762e8cf7abf20a4be16c62b8f30c1b62111b Mon Sep 17 00:00:00 2001 From: Angad <66992519+ThirdEyeSqueegee@users.noreply.github.com> Date: Fri, 13 Oct 2023 21:34:48 -0700 Subject: [PATCH] Update template --- CMakeLists.txt | 12 ++++++++++++ CMakePresets.json | 7 +++---- include/PCH.h | 8 +------- src/Hooks.cpp | 2 +- src/Main.cpp | 2 +- vcpkg.json | 4 ++-- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7af7ef..840f899 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,20 @@ 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() + 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 diff --git a/CMakePresets.json b/CMakePresets.json index a890ffb..0f49976 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,8 +10,8 @@ "name": "base", "hidden": true, "cacheVariables": { - "CMAKE_CXX_FLAGS": "$env{COMMONLIBSF_COMPILER} $env{COMMONLIBSF_PLATFORM} $env{COMMONLIBSF_TEXT} $penv{CXXFLAGS}", - "CMAKE_SHARED_LINKER_FLAGS": "$env{COMMONLIBSF_LINKER}", + "CMAKE_CXX_FLAGS": "$env{COMMONLIBSF_COMPILER} $env{COMMONLIBSF_PLATFORM} $penv{CXXFLAGS}", + "CMAKE_SHARED_LINKER_FLAGS": "$env{COMMONLIBSF_LINKER} $penv{SHARED_LINKER_FLAGS}", "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$:Debug>DLL" } }, @@ -56,8 +56,7 @@ "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "intelliSenseMode": "windows-msvc-x64", - "enableMicrosoftCodeAnalysis": true, - "enableClangTidyCodeAnalysis": true + "enableMicrosoftCodeAnalysis": true } } }, diff --git a/include/PCH.h b/include/PCH.h index cb6942e..f53abb7 100644 --- a/include/PCH.h +++ b/include/PCH.h @@ -138,16 +138,10 @@ /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ -// clang-format off #include -#include +#include #include -#include -#include -#include -// clang-format on - #include "Plugin.h" using namespace std::literals; diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 432f395..4658afe 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -4,7 +4,7 @@ namespace Hooks { void Install() noexcept { - REL::Relocation target{ REL::ID(151616), 0x22F }; + REL::Relocation target{ REL::ID(151616), 0x22f }; stl::write_thunk_call(target.address()); } } // namespace Hooks diff --git a/src/Main.cpp b/src/Main.cpp index 625decd..5d30351 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -19,7 +19,7 @@ SFSEPluginLoad(const SFSE::LoadInterface* sfse) { Init(sfse); - logger::info("{} {} is loading...", Plugin::Name, Plugin::Version.string("."sv)); + logger::info("{} {} is loading...", Plugin::Name, Plugin::Version.string()); if (const auto messaging{ SFSE::GetMessagingInterface() }; !messaging->RegisterListener(Listener)) return false; diff --git a/vcpkg.json b/vcpkg.json index eeef378..147f2f5 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,13 +8,13 @@ "default-registry": { "kind": "git", "repository": "https://github.com/microsoft/vcpkg", - "baseline": "b40de44891dc1cab11d4722094ae44807a837b98" + "baseline": "486a4640db740f5994e492eb60748111dfc48de7" }, "registries": [ { "kind": "git", "repository": "https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg", - "baseline": "f90c5a628164c55cb83ad82c4e4293e7015924e7", + "baseline": "55d62818c3b1fe6a06e6059aef1fe2a7006cefc0", "packages": ["commonlibsf"] } ]