Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#8588 from jamiesnape/macos-crosstool
Browse files Browse the repository at this point in the history
Update CROSSTOOL for Mac to support Bazel 0.12.0 and above
  • Loading branch information
jamiesnape authored Apr 13, 2018
2 parents 6435ac6 + d5837ae commit 6c4bb5a
Show file tree
Hide file tree
Showing 6 changed files with 367 additions and 108 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ if(CYGWIN OR NOT UNIX)
message(FATAL_ERROR "Cygwin and non-Unix platforms are NOT supported")
endif()

find_package(Bazel 0.10.1 MODULE REQUIRED)
if(APPLE)
set(MINIMUM_BAZEL_VERSION 0.12.0)
else()
set(MINIMUM_BAZEL_VERSION 0.10.1)
endif()

find_package(Bazel ${MINIMUM_BAZEL_VERSION} MODULE REQUIRED)

get_filename_component(C_COMPILER_REALPATH "${CMAKE_C_COMPILER}" REALPATH)
get_filename_component(C_COMPILER_NAME "${C_COMPILER_REALPATH}" NAME)
Expand Down
4 changes: 2 additions & 2 deletions doc/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ supported for CMake builds using the "Unix Makefiles" generator.
| Ubuntu 16.04 LTS ("Xenial") | | Bazel 0.10.1 | | Clang 4.0 | OpenJDK 8 | R2017a | 2.7.11 |
| | | CMake 3.5.1 | | GCC 5.4 | | | |
+-----------------------------+-----------------+--------------------+------------+ +--------+
| macOS 10.12 ("Sierra") | | Bazel 0.10.1 | Apple Clang 9.0.0 | Oracle 1.8 | | 2.7.14 |
+-----------------------------+ | CMake 3.10.2 | | +-------------------+ |
| macOS 10.12 ("Sierra") | | Bazel 0.12.0 | Apple Clang 9.0.0 | Oracle 1.8 | | 2.7.14 |
+-----------------------------+ | CMake 3.11.0 | | +-------------------+ |
| macOS 10.13 ("High Sierra") | | | | R2017b | |
+-----------------------------+-----------------+--------------------+------------+-------------------+--------+

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for i in "$@"; do
LIBS="${BASH_REMATCH[1]} $LIBS"
elif [[ "$i" =~ ^-L(.*)$ ]]; then
LIB_DIRS="${BASH_REMATCH[1]} $LIB_DIRS"
elif [[ "$i" =~ ^-Wl,-rpath,\$ORIGIN/(.*)$ ]]; then
elif [[ "$i" =~ ^-Wl,-rpath,\@loader_path/(.*)$ ]]; then
RPATHS="${BASH_REMATCH[1]} ${RPATHS}"
elif [[ "$i" = "-o" ]]; then
# output is coming
Expand Down
2 changes: 1 addition & 1 deletion third_party/com_github_bazelbuild_bazel/vendor.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The files in this directory tree (other than this file) are derived from Bazel:

remote = "https://github.com/bazelbuild/bazel.git"
sha = "600ab49a98bcb6d96231174b44bd4ae335de4dbf"
sha = "f98a7a2fedb3e714cef1038dcb85f83731150246"

Please update this metadata when copying new versions from upstream.
6 changes: 3 additions & 3 deletions tools/cc_toolchain/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ package(default_visibility = ["//visibility:public"])
cc_toolchain_suite(
name = "default-toolchain",
toolchains = {
"darwin|compiler": "cc_toolchain_apple",
"darwin_x86_64|compiler": "cc_toolchain_apple",
"k8|clang-4.0": "cc_toolchain_linux",
"k8|gcc-5": "cc_toolchain_linux",
"k8|gcc-6": "cc_toolchain_linux",
Expand Down Expand Up @@ -99,7 +99,7 @@ cc_toolchain(
name = "cc_toolchain_apple",
all_files = ":apple_toolchain_deps",
compiler_files = ":apple_toolchain_deps",
cpu = "darwin",
cpu = "darwin_x86_64",
dwp_files = ":apple_toolchain_deps",
dynamic_runtime_libs = [":empty"],
linker_files = ":apple_toolchain_deps",
Expand All @@ -118,7 +118,7 @@ config_setting(
name = "apple_debug",
values = {
"compilation_mode": "dbg",
"cpu": "darwin",
"cpu": "darwin_x86_64",
},
)

Expand Down
Loading

0 comments on commit 6c4bb5a

Please sign in to comment.