google-research
59 строк · 2.2 Кб
1# Bazel configuration file.
2# ------------------------------------------------------------------------------
3# Based on TensorFlow options in:
4# https://github.com/tensorflow/tensorflow/blob/master/.bazelrc
5#
6# Compiler options:
7# c++17: Build with C++17 options (links with libc++)
8# c++1z: Build with C++17 options (links with libc++)
9# c++17_gcc: Build with C++17 options (links with stdlibc++)
10# c++1z_gcc: Build with C++17 options (links with stdlibc++)
11#
12# Other build options:
13# short_logs: Only log errors during build, skip warnings.
14# verbose_logs: Show all compiler warnings during build.
15# libc++: Link against libc++ instead of stdlibc++
16
17# Suppress all warning messages.
18build:short_logs --output_filter=DONT_MATCH_ANYTHING
19build:verbose_logs --output_filter=
20build --config=short_logs
21
22# Allow builds using libc++ as a linker library. This is mostly for
23# OSSFuzz, so we also pass in the flags from environment to clean
24# build file.
25build:libc++ --action_env=CC
26build:libc++ --action_env=CXX
27build:libc++ --action_env=CXXFLAGS=-stdlib=libc++
28build:libc++ --action_env=PATH
29build:libc++ --define force_libcpp=enabled
30build:libc++ --linkopt -fuse-ld=lld
31
32# Build with C++ 17 features.
33build:c++17 --cxxopt=-std=c++1z
34build:c++17 --cxxopt=-stdlib=libc++
35build:c++1z --config=c++17
36build:c++17_gcc --cxxopt=-std=c++1z
37build:c++1z_gcc --config=c++17_gcc
38
39# Enable using platform specific build settings, except when cross-compiling for
40# mobile platforms.
41build --enable_platform_specific_config
42build:android --noenable_platform_specific_config
43build:ios --noenable_platform_specific_config
44
45# By default, build in C++ 17 mode.
46build:android --cxxopt=-std=c++17
47build:android --host_cxxopt=-std=c++17
48build:ios --cxxopt=-std=c++17
49build:ios --host_cxxopt=-std=c++17
50build:linux --cxxopt=-std=c++17
51build:linux --host_cxxopt=-std=c++17
52build:macos --cxxopt=-std=c++17
53build:macos --host_cxxopt=-std=c++17
54build:windows --cxxopt=/std:c++17
55build:windows --host_cxxopt=/std:c++17
56
57# Fix for thread_identity issues in absl:: on macOS.
58# See: https://github.com/abseil/abseil-cpp/issues/848
59build:macos --features=-supports_dynamic_linker
60