-
Notifications
You must be signed in to change notification settings - Fork 7k
[mygui] Support dynamic linking for MyGUI #41840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b139f64
Support dynamic linking for mygui
elsid 94cf0a0
Install MyGUI PDBs
AnyOldName3 1dd810d
Update port version
AnyOldName3 26108fc
Run vcpkg x-add-version --all
AnyOldName3 7ce64bc
Explicitly mark another library as static
AnyOldName3 8d0933f
Run vcpkg x-add-version --all
AnyOldName3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
diff --git a/Platforms/DirectX/DirectXPlatform/CMakeLists.txt b/Platforms/DirectX/DirectXPlatform/CMakeLists.txt | ||
index 169a2afe4..2ea45af2b 100644 | ||
--- a/Platforms/DirectX/DirectXPlatform/CMakeLists.txt | ||
+++ b/Platforms/DirectX/DirectXPlatform/CMakeLists.txt | ||
@@ -9,7 +9,7 @@ include_directories( | ||
|
||
include(${PROJECTNAME}.list) | ||
|
||
-add_library(${PROJECTNAME} ${HEADER_FILES} ${SOURCE_FILES}) | ||
+add_library(${PROJECTNAME} STATIC ${HEADER_FILES} ${SOURCE_FILES}) | ||
|
||
add_dependencies(${PROJECTNAME} MyGUIEngine) | ||
|
||
diff --git a/Platforms/DirectX11/DirectX11Platform/CMakeLists.txt b/Platforms/DirectX11/DirectX11Platform/CMakeLists.txt | ||
index 251fcdbe3..16d4f33a5 100644 | ||
--- a/Platforms/DirectX11/DirectX11Platform/CMakeLists.txt | ||
+++ b/Platforms/DirectX11/DirectX11Platform/CMakeLists.txt | ||
@@ -9,7 +9,7 @@ include_directories( | ||
|
||
include(${PROJECTNAME}.list) | ||
|
||
-add_library(${PROJECTNAME} ${HEADER_FILES} ${SOURCE_FILES}) | ||
+add_library(${PROJECTNAME} STATIC ${HEADER_FILES} ${SOURCE_FILES}) | ||
|
||
add_dependencies(${PROJECTNAME} MyGUIEngine) | ||
|
||
diff --git a/Platforms/Dummy/DummyPlatform/CMakeLists.txt b/Platforms/Dummy/DummyPlatform/CMakeLists.txt | ||
index 1055694f2..625391132 100644 | ||
--- a/Platforms/Dummy/DummyPlatform/CMakeLists.txt | ||
+++ b/Platforms/Dummy/DummyPlatform/CMakeLists.txt | ||
@@ -8,7 +8,7 @@ include_directories( | ||
|
||
include(${PROJECTNAME}.list) | ||
|
||
-add_library(${PROJECTNAME} ${HEADER_FILES} ${SOURCE_FILES}) | ||
+add_library(${PROJECTNAME} STATIC ${HEADER_FILES} ${SOURCE_FILES}) | ||
|
||
add_dependencies(${PROJECTNAME} MyGUIEngine) | ||
|
||
diff --git a/Platforms/Ogre/OgrePlatform/CMakeLists.txt b/Platforms/Ogre/OgrePlatform/CMakeLists.txt | ||
index a151abcf8..23f8a2373 100644 | ||
--- a/Platforms/Ogre/OgrePlatform/CMakeLists.txt | ||
+++ b/Platforms/Ogre/OgrePlatform/CMakeLists.txt | ||
@@ -8,7 +8,7 @@ include_directories( | ||
|
||
include(${PROJECTNAME}.list) | ||
|
||
-add_library(${PROJECTNAME} ${HEADER_FILES} ${SOURCE_FILES}) | ||
+add_library(${PROJECTNAME} STATIC ${HEADER_FILES} ${SOURCE_FILES}) | ||
|
||
add_dependencies(${PROJECTNAME} MyGUIEngine) | ||
|
||
diff --git a/Platforms/OpenGL/OpenGLPlatform/CMakeLists.txt b/Platforms/OpenGL/OpenGLPlatform/CMakeLists.txt | ||
index 0d58d3d71..78eaf0267 100644 | ||
--- a/Platforms/OpenGL/OpenGLPlatform/CMakeLists.txt | ||
+++ b/Platforms/OpenGL/OpenGLPlatform/CMakeLists.txt | ||
@@ -19,7 +19,7 @@ if (NOT MYGUI_USE_SYSTEM_GLEW) | ||
endif () | ||
add_definitions(-DGL_GLEXT_PROTOTYPES) | ||
|
||
-add_library(${PROJECTNAME} ${HEADER_FILES} ${SOURCE_FILES}) | ||
+add_library(${PROJECTNAME} STATIC ${HEADER_FILES} ${SOURCE_FILES}) | ||
|
||
add_dependencies(${PROJECTNAME} MyGUIEngine) | ||
|
||
diff --git a/Platforms/OpenGL3/OpenGL3Platform/CMakeLists.txt b/Platforms/OpenGL3/OpenGL3Platform/CMakeLists.txt | ||
index 27d96da3e..4dcee1601 100644 | ||
--- a/Platforms/OpenGL3/OpenGL3Platform/CMakeLists.txt | ||
+++ b/Platforms/OpenGL3/OpenGL3Platform/CMakeLists.txt | ||
@@ -19,7 +19,7 @@ if (NOT MYGUI_USE_SYSTEM_GLEW) | ||
endif () | ||
add_definitions(-DGL_GLEXT_PROTOTYPES) | ||
|
||
-add_library(${PROJECTNAME} ${HEADER_FILES} ${SOURCE_FILES}) | ||
+add_library(${PROJECTNAME} STATIC ${HEADER_FILES} ${SOURCE_FILES}) | ||
|
||
add_dependencies(${PROJECTNAME} MyGUIEngine) | ||
|
||
diff --git a/Platforms/OpenGLES/OpenGLESPlatform/CMakeLists.txt b/Platforms/OpenGLES/OpenGLESPlatform/CMakeLists.txt | ||
index bd6d9657b..ad31fc158 100644 | ||
--- a/Platforms/OpenGLES/OpenGLESPlatform/CMakeLists.txt | ||
+++ b/Platforms/OpenGLES/OpenGLESPlatform/CMakeLists.txt | ||
@@ -9,7 +9,7 @@ include_directories( | ||
|
||
include(${PROJECTNAME}.list) | ||
add_definitions(-DGL_GLEXT_PROTOTYPES) | ||
-add_library(${PROJECTNAME} ${HEADER_FILES} ${SOURCE_FILES}) | ||
+add_library(${PROJECTNAME} STATIC ${HEADER_FILES} ${SOURCE_FILES}) | ||
|
||
add_dependencies(${PROJECTNAME} MyGUIEngine) | ||
|
||
From 32e39f8de4b750ed5d2332ee18846f23b7e98df5 Mon Sep 17 00:00:00 2001 | ||
From: AnyOldName3 <[email protected]> | ||
Date: Tue, 29 Oct 2024 14:53:52 +0000 | ||
Subject: [PATCH] Explicitly mark another library as static | ||
|
||
I've also figured out why this problem wasn't obvious. | ||
It only happens when someone's used the CMake-standard BUILD_SHARED_LIBS option, which controls the default behaviour for add_library. | ||
When MyGUI is built as a standalone project, this won't be set (unless someone's done it manually) so it's fine. | ||
When MyGUI is built as part of a larger project (e.g. package manager like vcpkg or CPM, or as a nested project with FetchContent), it's likely to have been set by something else. | ||
|
||
It might be a good idea to pick the default value of MYGUI_STATIC to match BUILD_SHARED_LIBS if it's set, but I've not done that in this PR. | ||
--- | ||
Common/CMakeLists.txt | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt | ||
index e97507019..87a16290f 100644 | ||
--- a/Common/CMakeLists.txt | ||
+++ b/Common/CMakeLists.txt | ||
@@ -99,7 +99,7 @@ SOURCE_GROUP("Base" FILES | ||
Input/SDL/ResourceSDLPointer.cpp | ||
) | ||
|
||
-add_library(${PROJECTNAME} ${HEADER_FILES} ${SOURCE_FILES}) | ||
+add_library(${PROJECTNAME} STATIC ${HEADER_FILES} ${SOURCE_FILES}) | ||
|
||
mygui_set_platform_name(${MYGUI_RENDERSYSTEM}) | ||
add_dependencies(${PROJECTNAME} MyGUI.${MYGUI_PLATFORM_NAME}Platform) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.