Skip to content

Commit

Permalink
Bump minimum macOS version from 10.13 to 10.14
Browse files Browse the repository at this point in the history
Previously building the latest abseil-cpp would fail with:

```
 [ 97%] Building CXX object absl/status/CMakeFiles/status.dir/status.cc.o
/tmp/d20230909-93-us36r9/tmp/arm64-apple-darwin/ports/abseil/20230802.0/abseil-cpp-20230802.0/absl/status/status.cc:126:51: error: 'value' is unavailable: introduced in macOS 10.14
  if (index.has_value()) return (*payloads)[index.value()].payload;
```

`absel::optional` is aliased to C++17's `std::optional`, but `value()`
is only available in macOS 10.14 and up.

By default, rake-compiler-dock sets the default macOS target to 10.13
(https://github.com/rake-compiler/rake-compiler-dock/blob/9fecf9137b433f2458d9110dc536985111d0ce39/build/mk_osxcross.sh#L28C64-L28C640.
Note that I attempted to set `-mmacosx-version-min=10.14` via
`-DCMAKE_CXX_FLAGS`. However, it appears we have to set
`MACOSX_DEPLOYMENT_TARGET` or `-mmacosx-version-min=10.13` will be
inserted after any user-defined flags.
  • Loading branch information
stanhu authored and mudge committed Sep 23, 2023
1 parent c66733a commit 8f32657
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ namespace 'gem' do
task platform do
RakeCompilerDock.sh <<~SCRIPT, platform: platform, verbose: true
gem install bundler --no-document &&
export MACOSX_DEPLOYMENT_TARGET=10.14 &&
bundle &&
bundle exec rake gem:#{platform}:builder CMAKE=#{cmake}
SCRIPT
Expand Down
1 change: 1 addition & 0 deletions scripts/test-gem-build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [[ "${BUILD_NATIVE_GEM}" == "ruby" ]] ; then
bundle exec rake clean
bundle exec rake gem
else
export MACOSX_DEPLOYMENT_TARGET=10.14
bundle exec rake gem:${BUILD_NATIVE_GEM}:builder
fi

Expand Down

0 comments on commit 8f32657

Please sign in to comment.