From 1a7efcac4c4de32f9f5c4d5dbbe98d2826854aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 1 Jun 2020 17:06:41 +0200 Subject: [PATCH] modules: updated Corrade and Magnum modules. --- modules/FindCorrade.cmake | 36 ++++++++++++++++++++-------- modules/FindEGL.cmake | 4 ++-- modules/FindGLFW.cmake | 4 ++-- modules/FindMagnum.cmake | 4 ++-- modules/FindOpenGLES2.cmake | 4 ++-- modules/FindOpenGLES3.cmake | 4 ++-- modules/FindSDL2.cmake | 47 ++++++++++++++++++++++++------------- 7 files changed, 67 insertions(+), 36 deletions(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index e57e441..8a5fd6f 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -75,6 +75,9 @@ # included # CORRADE_BUILD_STATIC - Defined if compiled as static libraries. # Default are shared libraries. +# CORRADE_BUILD_STATIC_UNIQUE_GLOBALS - Defined if static libraries keep their +# globals unique even across different shared libraries. Enabled by default +# for static builds. # CORRADE_BUILD_MULTITHREADED - Defined if compiled in a way that makes it # possible to safely use certain Corrade features simultaenously in multiple # threads @@ -97,7 +100,7 @@ # with a MSVC frontend) # CORRADE_TARGET_MSVC - Defined if compiling with MSVC or Clang with # a MSVC frontend -# CORRADE_TARGET_MINGW` - Defined if compiling under MinGW +# CORRADE_TARGET_MINGW - Defined if compiling under MinGW # CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT - Defined if PluginManager # doesn't support dynamic plugin loading due to platform limitations # CORRADE_TESTSUITE_TARGET_XCTEST - Defined if TestSuite is targetting Xcode @@ -193,13 +196,19 @@ # # ...) # -# The macro adds preprocessor directive ``CORRADE_DYNAMIC_PLUGIN``. Additional -# libraries can be linked in via :command:`target_link_libraries(plugin_name ...) `. +# The macro adds a preprocessor directive ``CORRADE_DYNAMIC_PLUGIN`` when +# compiling ````. Additional libraries can be linked in via +# :command:`target_link_libraries(plugin_name ...) `. # On DLL platforms, the plugin DLLs and metadata files are put into -# ````/```` and the -# ``*.lib`` files into ````/````. -# On non-DLL platforms everything is put into ````/ -# ````. +# ```` / ```` and the +# ``*.lib`` files into ```` / +# ````. On non-DLL platforms everything is put +# into ```` / ````. +# +# If the plugin interface disables plugin metadata files, the +# ```` can be set to ``""``, in which case no metadata file is +# copied anywhere. Otherwise the metadata file is copied and renamed to +# ````, retaining its original extension. # # corrade_add_plugin( # @@ -224,8 +233,9 @@ # # ...) # -# The macro adds preprocessor directive ``CORRADE_STATIC_PLUGIN``. Additional -# libraries can be linked in via :command:`target_link_libraries(plugin_name ...) `. +# The macro adds a preprocessor directive ``CORRADE_STATIC_PLUGIN`` when +# compiling ````. Additional libraries can be linked in via +# :command:`target_link_libraries(plugin_name ...) `. # The ```` is ignored and included just for compatibility # with the :command:`corrade_add_plugin` command, everything is installed into # ````. Note that plugins built in debug configuration @@ -233,6 +243,11 @@ # suffix to make it possible to have both debug and release plugins installed # alongside each other. # +# If the plugin interface disables plugin metadata files, the +# ```` can be set to ``""``, in which case no metadata file is +# used. Otherwise the metadata file is bundled and renamed to +# ````, retaining its original extension. +# # corrade_add_static_plugin( # # @@ -257,7 +272,7 @@ # This file is part of Corrade. # # Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, -# 2017, 2018, 2019 Vladimír Vondruš +# 2017, 2018, 2019, 2020 Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -307,6 +322,7 @@ set(_corradeFlags MSVC2019_COMPATIBILITY BUILD_DEPRECATED BUILD_STATIC + BUILD_STATIC_UNIQUE_GLOBALS BUILD_MULTITHREADED TARGET_UNIX TARGET_APPLE diff --git a/modules/FindEGL.cmake b/modules/FindEGL.cmake index 45312c0..cc4210e 100644 --- a/modules/FindEGL.cmake +++ b/modules/FindEGL.cmake @@ -16,8 +16,8 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 -# Vladimír Vondruš +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, +# 2020 Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), diff --git a/modules/FindGLFW.cmake b/modules/FindGLFW.cmake index d4c497c..4955676 100644 --- a/modules/FindGLFW.cmake +++ b/modules/FindGLFW.cmake @@ -20,8 +20,8 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 -# Vladimír Vondruš +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, +# 2020 Vladimír Vondruš # Copyright © 2016 Jonathan Hale # # Permission is hereby granted, free of charge, to any person obtaining a diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index bb57335..7d466f0 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -195,8 +195,8 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 -# Vladimír Vondruš +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, +# 2020 Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), diff --git a/modules/FindOpenGLES2.cmake b/modules/FindOpenGLES2.cmake index 78730f7..b629449 100644 --- a/modules/FindOpenGLES2.cmake +++ b/modules/FindOpenGLES2.cmake @@ -19,8 +19,8 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 -# Vladimír Vondruš +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, +# 2020 Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), diff --git a/modules/FindOpenGLES3.cmake b/modules/FindOpenGLES3.cmake index 48ae023..38a1bff 100644 --- a/modules/FindOpenGLES3.cmake +++ b/modules/FindOpenGLES3.cmake @@ -19,8 +19,8 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 -# Vladimír Vondruš +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, +# 2020 Vladimír Vondruš # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake index 01fc6cf..c7e3527 100644 --- a/modules/FindSDL2.cmake +++ b/modules/FindSDL2.cmake @@ -19,8 +19,8 @@ # # This file is part of Magnum. # -# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 -# Vladimír Vondruš +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, +# 2020 Vladimír Vondruš # Copyright © 2018 Jonathan Hale # # Permission is hereby granted, free of charge, to any person obtaining a @@ -117,18 +117,33 @@ if(CORRADE_TARGET_WINDOWS) PATH_SUFFIXES ${_SDL2_RUNTIME_PATH_SUFFIX} ${_SDL2_LIBRARY_PATH_SUFFIX}) endif() -# (Static) iOS dependencies -if(CORRADE_TARGET_IOS AND SDL2_LIBRARY MATCHES ".*libSDL2.a$") - set(_SDL2_FRAMEWORKS - AudioToolbox - AVFoundation - CoreGraphics - CoreMotion - Foundation - GameController - Metal # needed since 2.0.8 - QuartzCore - UIKit) +# (Static) macOS / iOS dependencies +if(CORRADE_TARGET_APPLE AND SDL2_LIBRARY MATCHES ".*libSDL2.a$") + if(CORRADE_TARGET_IOS) + set(_SDL2_FRAMEWORKS + AudioToolbox + AVFoundation + CoreGraphics + CoreMotion + Foundation + GameController + Metal # needed since 2.0.8 + QuartzCore + UIKit) + else() + # Those are needed when building SDL statically using its CMake project + set(_SDL2_FRAMEWORKS + iconv # should be in the system + AudioToolbox + AVFoundation + Carbon + Cocoa + CoreAudio + CoreVideo + ForceFeedback + Foundation + IOKit) + endif() set(_SDL2_FRAMEWORK_LIBRARIES ) foreach(framework ${_SDL2_FRAMEWORKS}) find_library(_SDL2_${framework}_LIBRARY ${framework}) @@ -174,8 +189,8 @@ if(NOT TARGET SDL2::SDL2) INTERFACE_LINK_LIBRARIES Threads::Threads ${CMAKE_DL_LIBS}) endif() - # Link frameworks on iOS if we have a static SDL - if(CORRADE_TARGET_IOS AND SDL2_LIBRARY MATCHES ".*libSDL2.a$") + # Link frameworks on macOS / iOS if we have a static SDL + if(CORRADE_TARGET_APPLE AND SDL2_LIBRARY MATCHES ".*libSDL2.a$") set_property(TARGET SDL2::SDL2 APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${_SDL2_FRAMEWORK_LIBRARIES}) endif()