Skip to content

Commit

Permalink
Clean up .bazelrc for MacOS.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 363494734
Change-Id: Ib45cf82d6d6f45b7089b1250dd4c2547b1a175cb
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Mar 17, 2021
1 parent a0f6258 commit a88dbe9
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ build:libc++ --action_env=PATH
build:libc++ --define force_libcpp=enabled
build:libc++ --linkopt -fuse-ld=lld

# Trigger --config=<host platform>, except when cross-compiling.
build --enable_platform_specific_config
build:android --noenable_platform_specific_config
build:ios --noenable_platform_specific_config

# Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the
# target CPU to build transient dependencies correctly. See
# https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu
Expand All @@ -125,13 +120,7 @@ build:android_x86_64 --cpu=x86_64
build:android_x86_64 --fat_apk_cpu=x86_64

# Sets the default Apple platform to macOS.
build:macos --apple_platform_type=macos

# gRPC on MacOS requires this #define
build:macos --copt=-DGRPC_BAZEL_BUILD

# Settings for MacOS on ARM CPUs.
build:macos_arm64 --cpu=darwin_arm64
build --apple_platform_type=macos

# iOS configs for each architecture and the fat binary builds.
build:ios --apple_platform_type=ios
Expand All @@ -148,6 +137,11 @@ build:ios_x86_64 --cpu=ios_x86_64
build:ios_fat --config=ios
build:ios_fat --ios_multi_cpus=armv7,arm64,i386,x86_64

# Enables all the macos config options for macos_arm64
build:macos_arm64 --config=macos
build:macos_arm64 --apple_platform_type=macos
build:macos_arm64 --cpu=darwin_arm64

# For projects which use TensorFlow as part of a Bazel build process, putting
# nothing in a bazelrc will default to a monolithic build. The following line
# opts in to modular op registration support by default.
Expand Down Expand Up @@ -268,6 +262,13 @@ build:c++1z --config=c++17
build:c++17_gcc --cxxopt=-std=c++1z
build:c++1z_gcc --config=c++17_gcc

# Enable using platform specific build settings, except when cross-compiling for
# mobile platforms.
build --enable_platform_specific_config
build:android --noenable_platform_specific_config
build:ios --noenable_platform_specific_config
build:macos_arm64 --noenable_platform_specific_config

# Suppress C++ compiler warnings, otherwise build logs become 10s of MBs.
build:android --copt=-w
build:ios --copt=-w
Expand Down

0 comments on commit a88dbe9

Please sign in to comment.