Skip to content

Commit

Permalink
increase MACOSX_DEPLOYMENT_TARGET, but only for libabseil-tests
Browse files Browse the repository at this point in the history
Otherwise, the build fails with:
```
absl/functional/internal/any_invocable.h:624:28: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer
    state_.remote.target = ::new T(std::forward<Args>(args)...);
                           ^
```
  • Loading branch information
h-vetinari committed May 8, 2023
1 parent d6bf696 commit cbe8140
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipe/build-abseil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ fi
if [[ "$PKG_NAME" == "libabseil-tests" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DBUILD_TESTING=ON -DABSL_BUILD_TESTING=ON"
CMAKE_ARGS="${CMAKE_ARGS} -DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON"
if [[ "${target_platform}" == osx-* ]]; then
# test targets require C11's aligned_alloc, which doesn't compile even
# with a newer MACOSX_SDK_VERSION; need to bump target version too
CMAKE_ARGS="$(echo $CMAKE_ARGS | sed 's/-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 //g')"
CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13"
fi
fi

cmake -G Ninja \
Expand Down
3 changes: 3 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ outputs:
run:
- gtest
- {{ pin_subpackage("libabseil", exact=True) }}
run_constrained:
# only for libabseil-tests, see build-abseil.sh
- __osx >=10.13 # [osx and x86_64]

test:
requires:
Expand Down

0 comments on commit cbe8140

Please sign in to comment.