build changes

This commit is contained in:
nexusverypro
2026-07-03 22:22:19 +01:00
parent 35f52a4115
commit 3c55bd62e1
4 changed files with 28 additions and 7 deletions

View File

@@ -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"

View File

@@ -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

3
cmake/watermark.cpp.i Normal file
View File

@@ -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.";

18
resources/version.rc Normal file
View File

@@ -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