Fixed a possible startup crash with a non-ANSI Documents path via a Clib fix
This commit is contained in:
parent
6c33829ccd
commit
4a4b2a3b50
@ -149,7 +149,7 @@ message(STATUS "Fetching CommonLibSSE-GG...")
|
||||
FetchContent_Declare(
|
||||
CommonLibSSE
|
||||
GIT_REPOSITORY https://github.com/eddoursul/CommonLibSSE-GG
|
||||
GIT_TAG ff1a91b895af60fe7412b66544dfc4bce64c7286
|
||||
GIT_TAG 5507da62fef3853b15e6285f9a758b17c58f95b7
|
||||
)
|
||||
FetchContent_MakeAvailable(CommonLibSSE)
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ namespace {
|
||||
path /= "SKSE"sv;
|
||||
path /= "EnderalSE.log"sv;
|
||||
|
||||
auto sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(path.string(), true);
|
||||
auto sink = logger::file_sink(path);
|
||||
auto log = std::make_shared<spdlog::logger>("global log"s, std::move(sink));
|
||||
|
||||
log->set_level(spdlog::level::info);
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#include <ShlObj_core.h>
|
||||
#undef cdecl // Workaround for Clang 14 CMake configure error.
|
||||
|
||||
#include <spdlog/sinks/basic_file_sink.h>
|
||||
#include <spdlog/sinks/msvc_sink.h>
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ message(STATUS "Fetching CommonLibSSE-GG...")
|
||||
FetchContent_Declare(
|
||||
CommonLibSSE
|
||||
GIT_REPOSITORY https://github.com/eddoursul/CommonLibSSE-GG
|
||||
GIT_TAG ff1a91b895af60fe7412b66544dfc4bce64c7286
|
||||
GIT_TAG 5507da62fef3853b15e6285f9a758b17c58f95b7
|
||||
)
|
||||
FetchContent_MakeAvailable(CommonLibSSE)
|
||||
|
||||
|
||||
@ -5,40 +5,18 @@
|
||||
|
||||
using namespace SKSE;
|
||||
|
||||
namespace {
|
||||
|
||||
void InitializeLogging() {
|
||||
auto path = logger::log_directory();
|
||||
if (!path) {
|
||||
SKSE::stl::report_and_fail("Failed to find standard logging directory"sv);
|
||||
}
|
||||
|
||||
*path /= "EnderalSteam.log"sv;
|
||||
auto sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(path->string(), true);
|
||||
|
||||
auto log = std::make_shared<spdlog::logger>("global log"s, std::move(sink));
|
||||
|
||||
log->set_level(spdlog::level::info);
|
||||
log->flush_on(spdlog::level::info);
|
||||
|
||||
spdlog::set_default_logger(std::move(log));
|
||||
spdlog::set_pattern("[%l] %v"s);
|
||||
}
|
||||
}
|
||||
|
||||
SKSEPluginLoad(const LoadInterface* skse) {
|
||||
|
||||
GetLoadInterface(skse);
|
||||
|
||||
InitializeLogging();
|
||||
// Also opens EnderalSteam.log, through SKSE::log::init()
|
||||
Init(skse);
|
||||
|
||||
auto* plugin = PluginDeclaration::GetSingleton();
|
||||
auto version = plugin->GetVersion();
|
||||
logger::info("{} {} is loading...", plugin->GetName(), version);
|
||||
logger::info("Built against Steamworks SDK {}", ENDERAL_STEAM_SDK);
|
||||
|
||||
Init(skse);
|
||||
|
||||
// SDK 1.55: has to happen here, not from a game event: the game opens its own Steam session
|
||||
// from BSWin32SystemUtility during WinMain, and whichever session is opened first
|
||||
// decides which AppID the process stays registered as.
|
||||
|
||||
@ -104,7 +104,6 @@
|
||||
#include <Psapi.h>
|
||||
#undef cdecl // Workaround for Clang 14 CMake configure error.
|
||||
|
||||
#include <spdlog/sinks/basic_file_sink.h>
|
||||
#include <spdlog/sinks/msvc_sink.h>
|
||||
|
||||
// Compatible declarations with other sample projects.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user