Skip to content

Commit

Permalink
[setup] Add Xcode 16 specific build configuration
Browse files Browse the repository at this point in the history
Turn off a new optimization for dynamic_cast that is incompatible with
loading multiple shared libraries into a python process. Limit the new
option to clang versions that support it.
  • Loading branch information
rpoyner-tri committed Nov 22, 2024
1 parent 1c5e341 commit 22d9f96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ fi
workspace_dir="$(cd "$(dirname "${BASH_SOURCE}")/../../.." && pwd)"
bazelrc="${workspace_dir}/gen/environment.bazelrc"
arch="$(/usr/bin/arch)"
clang_version="$(clang --version |head -n1 |sed 's#.*(clang-\([0-9]*\)\..*#\1#g')"

mkdir -p "$(dirname "${bazelrc}")"
cat > "${bazelrc}" <<EOF
import %workspace%/tools/macos.bazelrc
import %workspace%/tools/macos-arch-${arch}.bazelrc
EOF

if (( $clang_version >= 1600 )); then
cat >> "${bazelrc}" <<EOF
import %workspace%/tools/apple-clang-1600.bazelrc
EOF
fi

# Prefetch the bazelisk download of bazel.
# This is especially helpful for the "Provisioned" images in CI.
(cd "${workspace_dir}" && bazelisk version) > /dev/null
2 changes: 2 additions & 0 deletions tools/apple-clang-1600.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://github.com/RobotLocomotion/drake/issues/22204
build:clang --copt=-fno-assume-unique-vtables

0 comments on commit 22d9f96

Please sign in to comment.