From 2551829f75d293d7b4e910b4957798caff01b847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 11 Dec 2019 19:09:59 +0100 Subject: [PATCH] Win32: Add VERSIONINFO resource to GLFW DLL This will let people see the API version in the Explorer property box. --- README.md | 1 + src/CMakeLists.txt | 5 +++++ src/glfw.rc.in | 30 ++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 src/glfw.rc.in diff --git a/README.md b/README.md index 24350b3b..9c86531e 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ information on what to include when reporting a bug. - Bugfix: Compiling with -Wextra-semi caused warnings (#1440) - [Win32] Added the `GLFW_WIN32_KEYBOARD_MENU` window hint for enabling access to the window menu + - [Win32] Added a version info resource to the GLFW DLL - [Win32] Bugfix: `GLFW_INCLUDE_VULKAN` plus `VK_USE_PLATFORM_WIN32_KHR` caused symbol redefinition (#1524) - [Win32] Bugfix: The cursor position event was emitted before its cursor enter diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b3d2e1e..35b24e6b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,6 +72,11 @@ if (_GLFW_X11 OR _GLFW_WAYLAND) endif() endif() +if (WIN32 AND BUILD_SHARED_LIBS) + configure_file(glfw.rc.in glfw.rc @ONLY) + set(glfw_SOURCES ${glfw_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/glfw.rc") +endif() + if (APPLE) # For some reason CMake didn't know about .m until version 3.16 set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m diff --git a/src/glfw.rc.in b/src/glfw.rc.in new file mode 100644 index 00000000..ac3460a7 --- /dev/null +++ b/src/glfw.rc.in @@ -0,0 +1,30 @@ + +#include + +VS_VERSION_INFO VERSIONINFO +FILEVERSION @GLFW_VERSION_MAJOR@,@GLFW_VERSION_MINOR@,@GLFW_VERSION_PATCH@,0 +PRODUCTVERSION @GLFW_VERSION_MAJOR@,@GLFW_VERSION_MINOR@,@GLFW_VERSION_PATCH@,0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE 0 +{ + BLOCK "StringFileInfo" + { + BLOCK "040904B0" + { + VALUE "CompanyName", "GLFW" + VALUE "FileDescription", "GLFW @GLFW_VERSION@ DLL" + VALUE "FileVersion", "@GLFW_VERSION@" + VALUE "OriginalFilename", "glfw3.dll" + VALUE "ProductName", "GLFW" + VALUE "ProductVersion", "@GLFW_VERSION@" + } + } + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x409, 1200 + } +} +