diff --git a/Build.ps1 b/Build.ps1 index fc1c3b0..0bf9e51 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -29,7 +29,6 @@ switch ($Target) { "msvc" { $VsPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\VsDevCmd.bat" - if (-not (Test-Path $VsPath)) { $VsPath = "${env:ProgramFiles}\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" } @@ -38,12 +37,6 @@ switch ($Target) { throw "MSVC environment not found. Install Visual Studio C++ build tools." } - cmd /c "`"$VsPath`" && set" | ForEach-Object { - if ($_ -match "^(.*?)=(.*)$") { - Set-Item -Path "env:$($matches[1])" -Value $matches[2] - } - } - $Generator = "Visual Studio 17 2022" $Arch = "x64" $ExtraArgs += "-A $Arch" diff --git a/CMakeLists.txt b/CMakeLists.txt index 681a6ea..a5461a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,13 @@ target_link_options(radhook PRIVATE > ) +if(MSVC) + target_sources(radhook PRIVATE resources/version.rc) +else() + configure_file(cmake/watermark.cpp.i ${CMAKE_BINARY_DIR}/generated/watermark.cpp @ONLY) + target_sources(radhook PRIVATE ${CMAKE_BINARY_DIR}/generated/watermark.cpp) +endif() + set_target_properties(radhook PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN YES diff --git a/cmake/watermark.cpp.i b/cmake/watermark.cpp.i new file mode 100644 index 0000000..10e1038 --- /dev/null +++ b/cmake/watermark.cpp.i @@ -0,0 +1,3 @@ +extern "C" const char* const g_watermark = + "libradhook, a lightweight and minimalistic cross-platform hooking library for windows and android. " + "built by RecRoomArchive. copyright (c) RecRoomArchive, all rights reserved."; \ No newline at end of file diff --git a/resources/version.rc b/resources/version.rc new file mode 100644 index 0000000..c68621c --- /dev/null +++ b/resources/version.rc @@ -0,0 +1,18 @@ +1 VERSIONINFO +FILEVERSION 1,1,0,0 +PRODUCTVERSION 1,1,0,0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Radium Development" + VALUE "FileDescription", "libradhook, a lightweight and minimalistic cross-platform hooking library for windows and android" + VALUE "LegalCopyright", "Copyright (c) RecRoomArchive" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END \ No newline at end of file