aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Hale <Squareys@googlemail.com>2021-02-18 22:02:27 +0100
committerGitHub <noreply@github.com>2021-02-18 13:02:27 -0800
commite7377f7992830bfc60fb2a7f43f300200822d82a (patch)
tree3511109456949c2a1ab60176d9e27dc061a58b15
parentaef2f37056fa9481f2783bf47d18f8705dbff19a (diff)
downloadvcpkg-e7377f7992830bfc60fb2a7f43f300200822d82a.tar.gz
vcpkg-e7377f7992830bfc60fb2a7f43f300200822d82a.zip
[magnum,-plugins] Fix deployment of plugin types and incorrect removal of plugin lib dir on unix (#16245)
* [magnum] Correctly deploy shaderconverter and sceneconverter plugins Signed-off-by: Squareys <squareys@googlemail.com> * [magnum,-plugins] Only remove plugin lib dirs for Windows platforms Signed-off-by: Squareys <squareys@googlemail.com> * [magnum,-plugins] Clean up deletion of plugin libs and clarify in comment Signed-off-by: Squareys <squareys@googlemail.com> * Update versions Co-authored-by: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com>
-rw-r--r--ports/magnum-plugins/CONTROL2
-rw-r--r--ports/magnum-plugins/portfile.cmake13
-rw-r--r--ports/magnum/CONTROL2
-rw-r--r--ports/magnum/magnumdeploy.ps110
-rw-r--r--ports/magnum/portfile.cmake67
-rw-r--r--versions/baseline.json4
-rw-r--r--versions/m-/magnum-plugins.json5
-rw-r--r--versions/m-/magnum.json5
8 files changed, 86 insertions, 22 deletions
diff --git a/ports/magnum-plugins/CONTROL b/ports/magnum-plugins/CONTROL
index f80c0f96f..1826224b7 100644
--- a/ports/magnum-plugins/CONTROL
+++ b/ports/magnum-plugins/CONTROL
@@ -1,6 +1,6 @@
Source: magnum-plugins
Version: 2020.06
-Port-Version: 2
+Port-Version: 3
Build-Depends: magnum[core]
Description: Plugins for magnum, C++11/C++14 graphics middleware for games and data visualization
Homepage: https://magnum.graphics/
diff --git a/ports/magnum-plugins/portfile.cmake b/ports/magnum-plugins/portfile.cmake
index 07dca2902..c90eaefe2 100644
--- a/ports/magnum-plugins/portfile.cmake
+++ b/ports/magnum-plugins/portfile.cmake
@@ -106,8 +106,17 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum)
else()
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d)
+ # On windows, plugins are "Modules" that cannot be linked as shared
+ # libraries, but are meant to be loaded at runtime.
+ # While this is handled adequately through the CMake project, the auto-magic
+ # linking with visual studio might try to link the import libs anyway.
+ #
+ # We delete the import libraries here to avoid the auto-magic linking
+ # for plugins which are loaded at runtime.
+ if(WIN32)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d)
+ endif()
endif()
# Handle copyright
diff --git a/ports/magnum/CONTROL b/ports/magnum/CONTROL
index 5c9c8fa1c..01e4a8fc7 100644
--- a/ports/magnum/CONTROL
+++ b/ports/magnum/CONTROL
@@ -1,6 +1,6 @@
Source: magnum
Version: 2020.06
-Port-Version: 3
+Port-Version: 4
Build-Depends: corrade[utility]
Description: C++11/C++14 graphics middleware for games and data visualization
Homepage: https://magnum.graphics/
diff --git a/ports/magnum/magnumdeploy.ps1 b/ports/magnum/magnumdeploy.ps1
index 203f2bac3..c32ed032b 100644
--- a/ports/magnum/magnumdeploy.ps1
+++ b/ports/magnum/magnumdeploy.ps1
@@ -23,16 +23,18 @@ function deployPluginsIfMagnum([string]$targetBinaryDir, [string]$MagnumPluginsD
}
}
- # We detect Magnum modules in use via the DLLs themselves.
- # Rather than checking for Magnum*.dll, we check for Magnum.dll and
- # Magnum-d.dll to avoid falsly matching MagnumTextureTools.dll for example.
+ # We detect Magnum modules in use via the DLLs that contain their
+ # plugin interfaces.
if ($targetBinaryName -like "MagnumAudio.dll" -or $targetBinaryName -like "MagnumAudio-d.dll") {
deployPlugins "audioimporters"
} elseif ($targetBinaryName -like "MagnumText.dll" -or $targetBinaryName -like "MagnumText-d.dll") {
deployPlugins "fonts"
deployPlugins "fontconverters"
- } elseif ($targetBinaryName -like "Magnum.dll" -or $targetBinaryName -like "Magnum-d.dll") {
+ } elseif ($targetBinaryName -like "MagnumTrade.dll" -or $targetBinaryName -like "MagnumTrade-d.dll") {
deployPlugins "importers"
deployPlugins "imageconverters"
+ deployPlugins "sceneconverters"
+ } elseif ($targetBinaryName -like "MagnumShaderTools.dll" -or $targetBinaryName -like "MagnumShaderTools-d.dll") {
+ deployPlugins "shaderconverters"
}
}
diff --git a/ports/magnum/portfile.cmake b/ports/magnum/portfile.cmake
index 3aa777c9b..9ad60180f 100644
--- a/ports/magnum/portfile.cmake
+++ b/ports/magnum/portfile.cmake
@@ -114,18 +114,61 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
- # move plugin libs to conventional place
- file(GLOB_RECURSE LIB_TO_MOVE ${CURRENT_PACKAGES_DIR}/lib/magnum/*)
- file(COPY ${LIB_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum)
- file(GLOB_RECURSE LIB_TO_MOVE_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/magnum/*)
- file(COPY ${LIB_TO_MOVE_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
+ # move plugin libs to conventional place
+ file(GLOB_RECURSE LIB_TO_MOVE ${CURRENT_PACKAGES_DIR}/lib/magnum/*)
+ file(COPY ${LIB_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum)
+
+ file(GLOB_RECURSE LIB_TO_MOVE_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d/*)
+ file(COPY ${LIB_TO_MOVE_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d)
else()
- file(COPY ${CMAKE_CURRENT_LIST_DIR}/magnumdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/bin/magnum)
- file(COPY ${CMAKE_CURRENT_LIST_DIR}/magnumdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/magnum-d)
+ # Unlike the magnum-plugins port, we cannot remove the lib files entirely here,
+ # As other importers might depend on them (e.g. AssimpImporter depends on AnyImageImporter)
+ # and modules are not allowed to have unresolved symbols, hence simply loading the
+ # dependencies in advance like on Unix does not work on Windows.
+ #
+ # On windows, plugins are "Modules" that cannot be linked as shared
+ # libraries, but are meant to be loaded at runtime.
+ # While this is handled adequately through the CMake project, the auto-magic
+ # linking with visual studio might try to link the import libs anyway.
+ #
+ # We delete most of the import libraries here to avoid the auto-magic linking
+ # for plugins which are loaded at runtime, but keep the afforementioned Any* plugins.
+ #
+ # See https://github.com/microsoft/vcpkg/pull/1235#issuecomment-308805989 for futher info.
+ if(WIN32)
+ file(GLOB_RECURSE LIB_TO_REMOVE ${CURRENT_PACKAGES_DIR}/lib/magnum/*)
+ file(GLOB_RECURSE LIB_TO_KEEP ${CURRENT_PACKAGES_DIR}/lib/magnum/*Any*)
+ if(LIB_TO_KEEP)
+ list(REMOVE_ITEM LIB_TO_REMOVE ${LIB_TO_KEEP})
+ endif()
+ if(LIB_TO_REMOVE)
+ file(REMOVE ${LIB_TO_REMOVE})
+ endif()
+
+ file(GLOB_RECURSE LIB_TO_REMOVE_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d/*)
+ file(GLOB_RECURSE LIB_TO_KEEP_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d/*Any*)
+ if(LIB_TO_KEEP_DBG)
+ list(REMOVE_ITEM LIB_TO_REMOVE_DBG ${LIB_TO_KEEP_DBG})
+ endif()
+ if(LIB_TO_REMOVE_DBG)
+ file(REMOVE ${LIB_TO_REMOVE_DBG})
+ endif()
+
+ # fonts and fontconverters don't have Any* plugins
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum/fonts)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum/fontconverters)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d/fonts)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d/fontconverters)
+ endif()
+
+ file(COPY ${CMAKE_CURRENT_LIST_DIR}/magnumdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/bin/magnum)
+ file(COPY ${CMAKE_CURRENT_LIST_DIR}/magnumdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/magnum-d)
endif()
-file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+file(INSTALL ${SOURCE_PATH}/COPYING
+ DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
+ RENAME copyright)
diff --git a/versions/baseline.json b/versions/baseline.json
index 39df75880..16b8a0f37 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -3674,7 +3674,7 @@
},
"magnum": {
"baseline": "2020.06",
- "port-version": 3
+ "port-version": 4
},
"magnum-extras": {
"baseline": "2020.06",
@@ -3686,7 +3686,7 @@
},
"magnum-plugins": {
"baseline": "2020.06",
- "port-version": 2
+ "port-version": 3
},
"mapbox-variant": {
"baseline": "1.2.0",
diff --git a/versions/m-/magnum-plugins.json b/versions/m-/magnum-plugins.json
index 0913d3788..3ab660883 100644
--- a/versions/m-/magnum-plugins.json
+++ b/versions/m-/magnum-plugins.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "79988d3cd16038434cacef0e4423f3b2e64f0a1b",
+ "version-string": "2020.06",
+ "port-version": 3
+ },
+ {
"git-tree": "b9b701869c5d4f5f4203702622d2bbfa58b6517f",
"version-string": "2020.06",
"port-version": 2
diff --git a/versions/m-/magnum.json b/versions/m-/magnum.json
index 171c91661..d2cdf0bb6 100644
--- a/versions/m-/magnum.json
+++ b/versions/m-/magnum.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "96fbedbdb7cac5cb1624af746d6e4b2cb4b57cc8",
+ "version-string": "2020.06",
+ "port-version": 4
+ },
+ {
"git-tree": "84fd6db3cf53cfcb736bfb14b08b86940f5588e1",
"version-string": "2020.06",
"port-version": 3