Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build_scripts/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the deployment target to 15.0 prevents developers from overriding it for custom builds (e.g., targeting a different iOS version). Allowing it to be overridden via an environment variable provides better flexibility.

Suggested change
-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_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} \
Expand Down
1 change: 1 addition & 0 deletions build_scripts/tvos/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the deployment target to 15.0 prevents developers from overriding it for custom tvOS builds. Allowing it to be overridden via an environment variable provides better flexibility.

Suggested change
-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET:-15.0} \

-DCMAKE_OSX_ARCHITECTURES=${arch} \
${sysroot_arg} \
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${buildpath}/${frameworkspath}/${platform}-${arch} \
Expand Down
4 changes: 4 additions & 0 deletions cmake/external_rules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions release_build_files/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions scripts/gha/build_ios_tvos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the deployment target to 15.0 in the GHA build script prevents custom builds from targeting different iOS/tvOS versions. Reading from the CMAKE_OSX_DEPLOYMENT_TARGET environment variable with a default of '15.0' provides a consistent way to override this across all build scripts.

Suggested change
cmd.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0')
cmd.append('-DCMAKE_OSX_DEPLOYMENT_TARGET={0}'.format(os.environ.get('CMAKE_OSX_DEPLOYMENT_TARGET', '15.0')))

if architecture:
cmd.append('-DCMAKE_OSX_ARCHITECTURES={0}'.format(architecture))
utils.run_command(cmd)
Expand Down
2 changes: 1 addition & 1 deletion test_mac_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test_mac_ios_simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
Loading