From cf3cf0e106699eda6f8f742fb950e55bd26aaddd Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 24 Mar 2024 19:37:51 +0100 Subject: [PATCH] dmg: fix SDL_version.h issue in sdl3-config-version.cmake --- .github/workflows/release.yml | 9 ++++++ Xcode/SDL/SDL.xcodeproj/project.pbxproj | 2 +- .../resources/CMake/sdl3-config-version.cmake | 28 ++++++++++++++----- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa5f1f207..981487109 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -165,6 +165,7 @@ jobs: -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \ -DCMAKE_SYSTEM_NAME=Darwin \ -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ + -Werror=dev \ -B build_darwin cmake --build build_darwin --config Release --verbose - name: 'CMake (configure + build) iOS' @@ -176,6 +177,7 @@ jobs: -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \ -DCMAKE_SYSTEM_NAME=iOS \ -DCMAKE_OSX_ARCHITECTURES="arm64" \ + -Werror=dev \ -B build_ios cmake --build build_ios --config Release --verbose - name: 'CMake (configure + build) tvOS' @@ -187,6 +189,7 @@ jobs: -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \ -DCMAKE_SYSTEM_NAME=tvOS \ -DCMAKE_OSX_ARCHITECTURES="arm64" \ + -Werror=dev \ -B build_tvos cmake --build build_tvos --config Release --verbose - name: 'CMake (configure + build) iOS simulator' @@ -201,6 +204,7 @@ jobs: -DCMAKE_SYSTEM_NAME=iOS \ -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ -DCMAKE_OSX_SYSROOT="${sysroot}" \ + -Werror=dev \ -B build_ios_simulator cmake --build build_ios_simulator --config Release --verbose - name: 'CMake (configure + build) tvOS simulator' @@ -215,6 +219,7 @@ jobs: -DCMAKE_SYSTEM_NAME=tvOS \ -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ -DCMAKE_OSX_SYSROOT="${sysroot}" \ + -Werror=dev \ -B build_tvos_simulator cmake --build build_tvos_simulator --config Release --verbose @@ -298,6 +303,7 @@ jobs: -DTEST_STATIC=FALSE ` -DTEST_TEST=TRUE ` -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" ` + -Werror=dev ` -B build_x86 -A win32 cmake --build build_x86 --config Release --verbose ctest --test-dir build_x86 --no-tests=error -C Release --output-on-failure @@ -309,6 +315,7 @@ jobs: -DTEST_STATIC=FALSE ` -DTEST_TEST=TRUE ` -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" ` + -Werror=dev ` -B build_x64 -A x64 cmake --build build_x64 --config Release --verbose ctest --test-dir build_x64 --no-tests=error -C Release --output-on-failure @@ -400,6 +407,7 @@ jobs: -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \ -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-i686.cmake" \ -DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \ + -Werror=dev \ -B build_x86 cmake --build build_x86 --config Release --verbose - name: 'CMake (configure + build) x86_64' @@ -412,5 +420,6 @@ jobs: -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \ -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-x86_64.cmake" \ -DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \ + -Werror=dev \ -B build_x64 cmake --build build_x64 --config Release --verbose diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 37f7bd3c7..7ddc4177e 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -2633,7 +2633,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "mkdir -p build/dmg-tmp/share/cmake/SDL3\ncp -a build/SDL3.xcframework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\ncp pkg-support/resources/CMake/sdl3-config.cmake build/dmg-tmp/share/cmake/SDL3\ncp pkg-support/resources/CMake/sdl3-config-version.cmake build/dmg-tmp/share/cmake/SDL3\n\n\nmkdir -p \n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL3 -srcfolder build/dmg-tmp build/SDL3.dmg\n\n# clean up\nrm -rf build/dmg-tmp\n"; + shellScript = "mkdir -p build/dmg-tmp/share/cmake/SDL3\ncp -a build/SDL3.xcframework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\ncp pkg-support/resources/CMake/sdl3-config.cmake build/dmg-tmp/share/cmake/SDL3\ncp pkg-support/resources/CMake/sdl3-config-version.cmake build/dmg-tmp/share/cmake/SDL3\n\nmkdir -p \n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL3 -srcfolder build/dmg-tmp build/SDL3.dmg\n\n# clean up\nrm -rf build/dmg-tmp\n"; }; F3B38CF0296F63D1005DA6D3 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; diff --git a/Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake index fbc9a3cee..21d6f7d7c 100644 --- a/Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake +++ b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake @@ -5,17 +5,27 @@ cmake_minimum_required(VERSION 3.12) -get_filename_component(_sdl3_xcframework_parent_path "../.." ABSOLUTE) - -set(_sdl3_xcframework "${_sdl3_xcframework_parent_path}/SDL3.xcframework") -set(_sdl3_version_h "${_sdl3_xcframework}/macos-arm64_x86_64/SDL3.framework/Headers/SDL_version.h") +get_filename_component(_sdl3_xcframework_parent_path "${CMAKE_CURRENT_LIST_DIR}" REALPATH) # /share/cmake/SDL3/ +get_filename_component(_sdl3_xcframework_parent_path "${_sdl3_xcframework_parent_path}" REALPATH) # /share/cmake/SDL3/ +get_filename_component(_sdl3_xcframework_parent_path "${_sdl3_xcframework_parent_path}" PATH) # /share/cmake +get_filename_component(_sdl3_xcframework_parent_path "${_sdl3_xcframework_parent_path}" PATH) # /share +get_filename_component(_sdl3_xcframework_parent_path "${_sdl3_xcframework_parent_path}" PATH) # / +set(_sdl3_xcframework "${_sdl3_xcframework_parent_path}/SDL3.xcframework") # /SDL3.xcframework +set(_sdl3_framework "${_sdl3_xcframework}/macos-arm64_x86_64/SDL3.framework") # /SDL3.xcframework/macos-arm64_x86_64/SDL3.framework +set(_sdl3_version_h "${_sdl3_framework}/Headers/SDL_version.h") # /SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Headers/SDL_version.h if(NOT EXISTS "${_sdl3_version_h}") - message(AUTHOR_WARNING "Cannot not find SDL_version.h. This script is meant to be placed in share/cmake/SDL3, next to SDL3.xcframework") + message(AUTHOR_WARNING "Cannot not find ${_sdl3_framework}. This script is meant to be placed in share/cmake/SDL3, next to SDL3.xcframework") return() endif() file(READ "${_sdl3_version_h}" _sdl_version_h) + +unset(_sdl3_xcframework_parent_path) +unset(_sdl3_framework) +unset(_sdl3_xcframework) +unset(_sdl3_version_h) + string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_version_h}") set(_sdl_major "${CMAKE_MATCH_1}") string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}") @@ -29,8 +39,12 @@ else() return() endif() -unset(_sdl3_xcframework) -unset(_sdl3_version_h) +unset(_sdl_major_re) +unset(_sdl_major) +unset(_sdl_minor_re) +unset(_sdl_minor) +unset(_sdl_patch_re) +unset(_sdl_patch) if(PACKAGE_FIND_VERSION_RANGE) # Package version must be in the requested version range