From 35cb00861b300ead897af52fd885d618b4460ac5 Mon Sep 17 00:00:00 2001 From: Austin Benoit Date: Fri, 7 Aug 2026 11:51:56 -0400 Subject: [PATCH] Fix Issue #1902: Explicitly set CMAKE_OSX_DEPLOYMENT_TARGET to 15.0 --- build_scripts/ios/build.sh | 1 + build_scripts/tvos/build.sh | 1 + cmake/external_rules.cmake | 4 ++++ release_build_files/readme.md | 4 ++++ scripts/gha/build_ios_tvos.py | 1 + test_mac_ios.sh | 2 +- test_mac_ios_simulator.sh | 2 +- 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build_scripts/ios/build.sh b/build_scripts/ios/build.sh index c594db826d..6ee1c2db7d 100755 --- a/build_scripts/ios/build.sh +++ b/build_scripts/ios/build.sh @@ -134,6 +134,7 @@ if ${generateMakefiles}; then mkdir -p ${buildpath}/ios_build_file/${platform}-${arch} && cd ${buildpath}/ios_build_file/${platform}-${arch} cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS \ ${sysroot_arg} \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 \ -DCMAKE_OSX_ARCHITECTURES=${arch} \ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${buildpath}/${frameworkspath}/${platform}-${arch} \ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${buildpath}/${frameworkspath}/${platform}-${arch} \ diff --git a/build_scripts/tvos/build.sh b/build_scripts/tvos/build.sh index 1b87066c5c..587437b96f 100755 --- a/build_scripts/tvos/build.sh +++ b/build_scripts/tvos/build.sh @@ -135,6 +135,7 @@ if ${generateMakefiles}; then echo "generate Makefiles start" mkdir -p ${buildpath}/tvos_build_file/${platform}-${arch} && cd ${buildpath}/tvos_build_file/${platform}-${arch} cmake -DCMAKE_SYSTEM_NAME=tvOS \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 \ -DCMAKE_OSX_ARCHITECTURES=${arch} \ ${sysroot_arg} \ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${buildpath}/${frameworkspath}/${platform}-${arch} \ diff --git a/cmake/external_rules.cmake b/cmake/external_rules.cmake index b2416191c1..4a3d846883 100644 --- a/cmake/external_rules.cmake +++ b/cmake/external_rules.cmake @@ -169,6 +169,10 @@ function(build_external_dependencies) set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}) endif() + if(CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS} + -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}) + endif() elseif(MSVC) # Propagate MSVC build flags. set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS} diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 69cf7ca6fa..83d8df55cd 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -613,6 +613,10 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes +### Upcoming +- Changes + - General (iOS): Fixed an issue where prebuilt iOS/tvOS frameworks had an incorrect minimum deployment target (minos), which caused linker warnings. + ### 13.11.0 - Changes - General (Android): Update to Firebase Android BoM version 34.17.0. diff --git a/scripts/gha/build_ios_tvos.py b/scripts/gha/build_ios_tvos.py index 62d68b557b..7dc6588a31 100644 --- a/scripts/gha/build_ios_tvos.py +++ b/scripts/gha/build_ios_tvos.py @@ -494,6 +494,7 @@ def cmake_configure(source_path, build_path, toolchain, archive_output_path, cmd.append('-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY={0}'.format(archive_output_path)) cmd.append('-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={0}'.format(archive_output_path)) cmd.append('-DCMAKE_RUNTIME_OUTPUT_DIRECTORY={0}'.format(archive_output_path)) + cmd.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0') if architecture: cmd.append('-DCMAKE_OSX_ARCHITECTURES={0}'.format(architecture)) utils.run_command(cmd) diff --git a/test_mac_ios.sh b/test_mac_ios.sh index 04f353d7cb..f32b1dbb0e 100755 --- a/test_mac_ios.sh +++ b/test_mac_ios.sh @@ -27,7 +27,7 @@ cd mac_ios_build # Configure cmake with tests enabled # and disable use of libsecret due to not working on kokoro builders -cmake -DCMAKE_SYSTEM_NAME=iOS .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON "$@" +cmake -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON "$@" # Build the SDK and the tests cpus=$(sysctl -n hw.ncpu) diff --git a/test_mac_ios_simulator.sh b/test_mac_ios_simulator.sh index ec98fb58fc..aec2086915 100755 --- a/test_mac_ios_simulator.sh +++ b/test_mac_ios_simulator.sh @@ -25,7 +25,7 @@ set -x mkdir -p mac_ios_simulator_build cd mac_ios_simulator_build -cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator .. -DCLANG_ENABLE_MODULES=YES -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON "$@" +cmake -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 -DCMAKE_OSX_SYSROOT=iphonesimulator .. -DCLANG_ENABLE_MODULES=YES -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON "$@" # Build the SDK and the tests cmake --build .