From 98fff575ddc837076ea4793a502b0c5db2b19e5e Mon Sep 17 00:00:00 2001 From: O01eg Date: Mon, 23 Dec 2024 18:22:23 +0400 Subject: [PATCH] Try to disable SDL Framework installation --- CMakeLists.txt | 4 +- ...4-CMake-Add-MacOSX-Framework-support.patch | 52 ---------------- ...Make-Set-framework-install-directory.patch | 25 -------- ...C_HEADER-property-to-install-headers.patch | 61 ------------------- 4 files changed, 2 insertions(+), 140 deletions(-) delete mode 100644 patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch delete mode 100644 patches/sdl/0005-CMake-Set-framework-install-directory.patch delete mode 100644 patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bfddfb..1115756 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,9 +374,9 @@ if(WIN32) else() set(SDL_CONFIGURE_FLAGS -DBUILD_SHARED_LIBS=ON - -DBUILD_FRAMEWORK=ON + -DBUILD_FRAMEWORK=OFF ) - set(SDL_CONFIGURE_INSTALL_DIR ${SDK_INSTALL_DIR}/Frameworks) + set(SDL_CONFIGURE_INSTALL_DIR ${SDK_INSTALL_DIR}) endif() ExternalProject_PatchSet(sdl SDL_PATCHSET) diff --git a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch b/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch deleted file mode 100644 index 5f078d4..0000000 --- a/patches/sdl/0004-CMake-Add-MacOSX-Framework-support.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 43524a3266a76d091e41c4aca86e009fd06bae9d Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 18:10:19 +0200 -Subject: [PATCH] CMake: Add MacOSX Framework support - ---- - CMakeLists.txt | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a596eec..7f6e574 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -514,6 +514,9 @@ dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_H - set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF) - option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "") - set_option(SDL_CCACHE "Use Ccache to speed up build" ON) -+if(APPLE) -+ set_option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF) -+endif() - - option(SDL_WERROR "Enable -Werror" OFF) - -@@ -3320,6 +3323,16 @@ if(SDL_SHARED) - endif() - set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") - endif() -+ if(APPLE AND BUILD_FRAMEWORK) -+ set_target_properties(SDL2 PROPERTIES -+ FRAMEWORK TRUE -+ FRAMEWORK_VERSION ${SDL_VERSION} -+ MACOSX_FRAMEWORK_IDENTIFIER org.libsdl.SDL2 -+ MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${SDL_VERSION} -+ MACOSX_FRAMEWORK_BUNDLE_VERSION ${SDL_VERSION} -+ MACOSX_RPATH ON -+ OUTPUT_NAME "SDL2") -+ endif() - # FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS - target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD}) - target_include_directories(SDL2 PUBLIC -@@ -3518,7 +3531,7 @@ if(NOT SDL2_DISABLE_INSTALL) - install(FILES ${SDL2_BINARY_DIR}/sdl2.pc - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - endif() -- if(NOT (WINDOWS OR CYGWIN) OR MINGW) -+ if((NOT (WINDOWS OR CYGWIN) OR MINGW) AND (NOT BUILD_FRAMEWORK)) - if(SDL_SHARED) - set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc. - get_target_property(SONAME SDL2 OUTPUT_NAME) --- -2.14.3 - diff --git a/patches/sdl/0005-CMake-Set-framework-install-directory.patch b/patches/sdl/0005-CMake-Set-framework-install-directory.patch deleted file mode 100644 index 1948f8e..0000000 --- a/patches/sdl/0005-CMake-Set-framework-install-directory.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 4243d36624b0ab5bf80c3ab9c0269e419a4beb09 Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 18:58:04 +0200 -Subject: [PATCH] CMake: Set framework install directory - ---- - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f32165cb7..50446f868 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3189,6 +3189,7 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" -- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") -+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}") - endif() - - if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) --- -2.14.3 - diff --git a/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch b/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch deleted file mode 100644 index ed34cf6..0000000 --- a/patches/sdl/0006-CMake-Use-PUBLIC_HEADER-property-to-install-headers.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 8a05500c8ad7b72f38ca3ff67116b1e2e4d61afa Mon Sep 17 00:00:00 2001 -From: Marcel Metz -Date: Fri, 1 Apr 2016 17:51:35 +0200 -Subject: [PATCH] CMake: Use PUBLIC_HEADER property to install headers - ---- - CMakeLists.txt | 34 ++++++++++++++++++---------------- - 1 file changed, 18 insertions(+), 16 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1bc7ffb..5bc532e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -3278,7 +3278,7 @@ if(APPLE) - endif() - - if(SDL_SHARED) -- add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES}) -+ add_library(SDL2 SHARED ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h ${SOURCE_FILES} ${VERSION_SOURCES}) - add_dependencies(SDL2 sdl_headers_copy) - # alias target for in-tree builds - add_library(SDL2::SDL2 ALIAS SDL2) -@@ -3291,6 +3291,8 @@ if(SDL_SHARED) - endif() - endif() - if(APPLE) -+ set_target_properties(SDL2 PROPERTIES -+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h") - # FIXME: Remove SOVERSION in SDL3 - set_target_properties(SDL2 PROPERTIES - MACOSX_RPATH 1 -@@ -3356,13 +3358,15 @@ if(SDL_SHARED) - endif() - - if(SDL_STATIC) -- add_library(SDL2-static STATIC ${SOURCE_FILES}) -+ add_library(SDL2-static STATIC ${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h ${SOURCE_FILES}) - add_dependencies(SDL2-static sdl_headers_copy) - # alias target for in-tree builds - add_library(SDL2::SDL2-static ALIAS SDL2-static) - set_target_properties(SDL2-static PROPERTIES - OUTPUT_NAME "${sdl_static_libname}" - POSITION_INDEPENDENT_CODE "${SDL_STATIC_PIC}") -+ set_target_properties(SDL2-static PROPERTIES -+ PUBLIC_HEADER "${SDL2_INCLUDE_FILES} ${SDL_GENERATED_HEADERS} ${SDL2_BINARY_DIR}/include/SDL_revision.h ${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h") - target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB) - # TODO: Win32 platforms keep the same suffix .lib for import and static - # libraries - do we need to consider this? -@@ -3410,7 +3414,8 @@ if(NOT SDL2_DISABLE_INSTALL) - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -- FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}") -+ FRAMEWORK DESTINATION "${CMAKE_INSTALL_PREFIX}" -+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2") - endif() - - if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) --- -2.14.3 -