Skip to content

Commit

Permalink
Fix template
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee committed Sep 13, 2023
1 parent 404e688 commit bf7bc6d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
11 changes: 6 additions & 5 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_FLAGS": "$env{COMMONLIBSF_COMPILER} $env{COMMONLIBSF_PLATFORM} $env{COMMONLIBSF_TEXT}",
"CMAKE_SHARED_LINKER_FLAGS": "$env{COMMONLIBSF_LINKER}"
"CMAKE_SHARED_LINKER_FLAGS": "$env{COMMONLIBSF_LINKER}",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
}
},
{
"name": "vcpkg",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-windows",
"VCPKG_HOST_TRIPLET": "x64-windows",
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md",
"VCPKG_HOST_TRIPLET": "x64-windows-static-md",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake"
}
},
Expand Down Expand Up @@ -49,9 +50,9 @@
"COMMONLIBSF_LINKER": "/CGTHREADS:8 /MACHINE:x64 /DEBUG:FULL"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "/fp:fast /GL /GR- /Gw /O2 /Ob3 /Qpar /MD",
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "/fp:fast /GL /GR- /Gw /O2 /Ob3 /Qpar",
"CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO": "/LTCG:INCREMENTAL /OPT:REF,ICF=4",
"CMAKE_CXX_FLAGS_DEBUG": "/Od /MDd",
"CMAKE_CXX_FLAGS_DEBUG": "/Od",
"CMAKE_SHARED_LINKER_FLAGS_DEBUG": "/DEBUGTYPE:FIXUP"
},
"vendor": {
Expand Down
8 changes: 5 additions & 3 deletions cmake/Plugin.h.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#pragma once

using namespace std::string_view_literals;

namespace Plugin
{
static constexpr auto Name = "@PROJECT_NAME@";
static constexpr auto Author = "AuthorName";
static constexpr auto Version = @PROJECT_VERSION_MAJOR@u * 10000 + @PROJECT_VERSION_MINOR@u * 100 + @PROJECT_VERSION_PATCH@u;
static constexpr auto Name = "PluginName"sv;
static constexpr auto Author = "AuthorName"sv;
static constexpr auto Version = REL::Version{ @PROJECT_VERSION_MAJOR@, @PROJECT_VERSION_MINOR@, @PROJECT_VERSION_PATCH@, 0 };
} // namespace Plugin
8 changes: 5 additions & 3 deletions include/Plugin.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#pragma once

using namespace std::string_view_literals;

namespace Plugin
{
static constexpr auto Name = "PluginName";
static constexpr auto Author = "AuthorName";
static constexpr auto Version = 0u * 10000 + 0u * 100 + 1u;
static constexpr auto Name = "PluginName"sv;
static constexpr auto Author = "AuthorName"sv;
static constexpr auto Version = REL::Version{ 0, 0, 1, 0 };
} // namespace Plugin
6 changes: 3 additions & 3 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SFSEPluginLoad(const SFSE::LoadInterface* sfse)
{
InitializeLogging();

logger::info("{} {} is loading...", Plugin::Name, Plugin::Version);
logger::info("{} {} is loading...", Plugin::Name, Plugin::Version.string("."sv));

Init(sfse);

Expand All @@ -30,10 +30,10 @@ SFSEPluginLoad(const SFSE::LoadInterface* sfse)
SFSEPluginVersion = []() noexcept {
SFSE::PluginVersionData data{};

data.PluginVersion(Plugin::Version);
data.PluginVersion(Plugin::Version.pack());
data.PluginName(Plugin::Name);
data.AuthorName(Plugin::Author);
data.UsesSigScanning(false);
data.UsesSigScanning(true);
data.HasNoStructUse(true);
data.CompatibleVersions({ SFSE::RUNTIME_LATEST });

Expand Down
6 changes: 5 additions & 1 deletion src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ void Settings::LoadSettings() noexcept
CSimpleIniA ini;

ini.SetUnicode();
ini.LoadFile(R"(.\Data\SFSE\Plugins\PluginName.ini)");
if (ini.LoadFile(R"(.\Data\SFSE\Plugins\PluginName.ini)") <=> 0 < 0)
{
logger::error("ERROR: Failed to load ini");
return;
}

debug_logging = ini.GetBoolValue("Log", "Debug");

Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
"kind": "git",
"repository": "https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg",
"baseline": "9e739fd13c18190e71e54a6bab300c666ae1041d",
"baseline": "5f9859537f348417963ac2d28f3f8242685a943f",
"packages": ["commonlibsf"]
}
]
Expand Down

0 comments on commit bf7bc6d

Please sign in to comment.