overlaytopleft/games-fps/gzdoom/files/0049-Fix-BUILD_SHARED_LIBS-build-option-on-Windows.patch

28 lines
985 B
Diff

From 571637d6ea1f12f7b86ee223f33de1cc0351e17d Mon Sep 17 00:00:00 2001
From: Chris Cowan <agentme49@gmail.com>
Date: Sat, 13 May 2023 21:39:55 -0700
Subject: [PATCH 49/51] Fix BUILD_SHARED_LIBS build option on Windows
This commit fixes the build error "unresolved external symbol GetModuleInformation" when the project is built on Windows with BUILD_SHARED_LIBS enabled.
Gzdoom must be linked against "psapi". When BUILD_SHARED_LIBS is off (default), it gets linked because the discord-rpc library is linked against it and then statically linked into the project. The issue is fixed by making Gzdoom itself explicitly link against "psapi" too.
---
src/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 911e35dce..889a99dba 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -54,6 +54,7 @@ if( WIN32 )
add_definitions( -D_WIN32 )
set( PROJECT_LIBRARIES
+ psapi
wsock32
winmm
dinput8
--
2.39.3