Skip to content

Commit

Permalink
Make build configuration accessible in source files; add logging of b…
Browse files Browse the repository at this point in the history
…uild configuration
  • Loading branch information
narknon committed Oct 31, 2023
1 parent 15952e6 commit dd753e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion UE4SS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (NOT res EQUAL 0)
set(UE4SS_LIB_BUILD_GITSHA "0")
endif ()

# Make the hard-coded build numbers available to source files
# Make the hard-coded build numbers and current configuration available to source files
add_compile_definitions(
UE4SS_LIB_VERSION_MAJOR=${UE4SS_LIB_VERSION_MAJOR}
UE4SS_LIB_VERSION_MINOR=${UE4SS_LIB_VERSION_MINOR}
Expand All @@ -46,6 +46,7 @@ add_compile_definitions(
UE4SS_LIB_BETA_STARTED=$<BOOL:${UE4SS_LIB_BETA_IS_STARTED}>
UE4SS_LIB_IS_BETA=$<BOOL:${UE4SS_LIB_IS_BETA}>
UE4SS_LIB_BUILD_GITSHA="${UE4SS_LIB_BUILD_GITSHA}"
UE4SS_CONFIGURATION="$<CONFIG>"
)
# Versioning -> END

Expand Down
11 changes: 7 additions & 4 deletions UE4SS/src/UE4SSProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,15 @@ namespace RC
std::format(L"{}",
UE4SS_LIB_BETA_STARTED == 0 ? L"" : (UE4SS_LIB_IS_BETA == 0 ? L" Beta #?" : std::format(L" Beta #{}", UE4SS_LIB_VERSION_BETA))),
to_wstring(UE4SS_LIB_BUILD_GITSHA));
#ifdef WITH_CASE_PRESERVING_NAME
Output::send(STR("WITH_CASE_PRESERVING_NAME: Yes\n\n"));

#ifdef __clang__
#define UE4SS_COMPILER L"Clang"
#else
Output::send(STR("WITH_CASE_PRESERVING_NAME: No\n\n"));
#define UE4SS_COMPILER L"MSVC"
#endif


Output::send(STR("Build Configuration: {} ({})\n"), to_wstring(UE4SS_CONFIGURATION), UE4SS_COMPILER);

m_load_library_a_hook = std::make_unique<PLH::IatHook>("kernel32.dll",
"LoadLibraryA",
std::bit_cast<uint64_t>(&HookedLoadLibraryA),
Expand Down

0 comments on commit dd753e9

Please sign in to comment.