diff --git a/src/system/CMakeLists.txt b/src/system/CMakeLists.txt index 6e18128..d01f0ed 100644 --- a/src/system/CMakeLists.txt +++ b/src/system/CMakeLists.txt @@ -84,6 +84,36 @@ endif() if(WIN32) target_link_libraries(rexruntime PRIVATE ws2_32) + + # Version metadata for the runtime DLL. Unsigned binaries without any + # version resource are prone to antivirus false positives; embedding + # identity here also lets crash dumps and support logs name the build. + # The embedding application may override these before including the SDK. + enable_language(RC) + if(NOT REXGLUE_RUNTIME_RC_VERSION) + set(REXGLUE_RUNTIME_RC_VERSION "0,0,0,0") + endif() + if(NOT REXGLUE_RUNTIME_RC_VERSION_STRING) + set(REXGLUE_RUNTIME_RC_VERSION_STRING "0.0.0") + endif() + if(NOT REXGLUE_RUNTIME_RC_PRODUCT_NAME) + set(REXGLUE_RUNTIME_RC_PRODUCT_NAME "rexglue") + endif() + if(NOT REXGLUE_RUNTIME_RC_COMPANY) + set(REXGLUE_RUNTIME_RC_COMPANY "rexglue project") + endif() + if(NOT REXGLUE_RUNTIME_RC_DESCRIPTION) + set(REXGLUE_RUNTIME_RC_DESCRIPTION "rexglue guest runtime library") + endif() + if(NOT REXGLUE_RUNTIME_RC_COPYRIGHT) + set(REXGLUE_RUNTIME_RC_COPYRIGHT "(c) rexglue contributors") + endif() + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/rexruntime_version.rc.in + ${CMAKE_CURRENT_BINARY_DIR}/rexruntime_version.rc + @ONLY) + target_sources(rexruntime PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/rexruntime_version.rc) endif() if(REXGLUE_USE_D3D12) diff --git a/src/system/rexruntime_version.rc.in b/src/system/rexruntime_version.rc.in new file mode 100644 index 0000000..f02f216 --- /dev/null +++ b/src/system/rexruntime_version.rc.in @@ -0,0 +1,28 @@ +1 VERSIONINFO + FILEVERSION @REXGLUE_RUNTIME_RC_VERSION@ + PRODUCTVERSION @REXGLUE_RUNTIME_RC_VERSION@ + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "@REXGLUE_RUNTIME_RC_COMPANY@" + VALUE "FileDescription", "@REXGLUE_RUNTIME_RC_DESCRIPTION@" + VALUE "FileVersion", "@REXGLUE_RUNTIME_RC_VERSION_STRING@" + VALUE "InternalName", "rexruntime" + VALUE "LegalCopyright", "@REXGLUE_RUNTIME_RC_COPYRIGHT@" + VALUE "OriginalFilename", "rexruntime.dll" + VALUE "ProductName", "@REXGLUE_RUNTIME_RC_PRODUCT_NAME@" + VALUE "ProductVersion", "@REXGLUE_RUNTIME_RC_VERSION_STRING@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END