Skip to content

Commit f0d89b3

Browse files
authored
[NFC] Organize .bazelrc into logical sections.
1 parent 90330db commit f0d89b3

1 file changed

Lines changed: 43 additions & 21 deletions

File tree

.bazelrc

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Enable logging rc options.
22
common --announce_rc
33

4-
# ----CONFIG OPTIONS----
4+
###############################################################################
5+
# Global options for building OR-Tools.
6+
###############################################################################
7+
58
build --flag_alias=with_bop=//ortools/linear_solver:with_bop
69
build --flag_alias=with_cbc=//ortools/linear_solver:with_cbc
710
build --flag_alias=with_clp=//ortools/linear_solver:with_clp
@@ -14,26 +17,44 @@ build --flag_alias=with_pdlp=//ortools/linear_solver:with_pdlp
1417
build --flag_alias=with_scip=//ortools/linear_solver:with_scip
1518
build --flag_alias=with_xpress=//ortools/linear_solver:with_xpress
1619

17-
# Sets the default Apple platform to macOS.
18-
build --apple_platform_type=macos
19-
20-
# By default, build OR-Tools in C++ 17 mode, with various extra flags per
21-
# platform.
22-
build --enable_platform_specific_config
20+
# Enable absl::string_view support in @googletest
21+
build --define absl=1
2322

2423
# Fix the python version
2524
build --@rules_python//python/config_settings:python_version=3.12
2625

27-
# Per platform parameters.
28-
build:linux --cxxopt="-std=c++17" --cxxopt=-Wno-sign-compare
29-
build:linux --host_cxxopt="-std=c++17" --host_cxxopt=-Wno-sign-compare
26+
###############################################################################
27+
# Per plaform options
28+
###############################################################################
29+
30+
# By default, build with various extra flags per platform.
31+
build --enable_platform_specific_config
3032

33+
###############################################################################
34+
# Options for Linux.
35+
###############################################################################
36+
37+
build:linux --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
38+
build:linux --cxxopt=-Wno-sign-compare --host_cxxopt=-Wno-sign-compare
39+
40+
41+
###############################################################################
42+
# Options for macOS.
43+
###############################################################################
44+
45+
# Sets the default Apple platform to macOS.
46+
build --apple_platform_type=macos
3147
build:macos --features=-supports_dynamic_linker
32-
build:macos --cxxopt="-std=c++17" --cxxopt=-Wno-sign-compare --cxxopt=-mmacos-version-min=10.15 --cxxopt=-Wno-dangling-field
33-
build:macos --host_cxxopt="-std=c++17" --host_cxxopt=-Wno-sign-compare --host_cxxopt=-mmacos-version-min=10.15 --host_cxxopt=-Wno-dangling-field
48+
build:macos --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
49+
build:macos --cxxopt=-Wno-sign-compare --host_cxxopt=-Wno-sign-compare
50+
build:macos --cxxopt=-Wno-dangling-field --host_cxxopt=-Wno-dangling-field
51+
build:macos --cxxopt=-mmacos-version-min=10.15 --host_cxxopt=-mmacos-version-min=10.15
3452

35-
build:windows --cxxopt="/std:c++20"
36-
build:windows --host_cxxopt="/std:c++20"
53+
###############################################################################
54+
# Options for Windows.
55+
###############################################################################
56+
57+
build:windows --cxxopt=/std:c++20 --host_cxxopt=/std:c++20
3758

3859
# Enable the runfiles symlink tree on Windows. This makes it possible to build
3960
# the pip package on Windows without an intermediate data-file archive, as the
@@ -42,7 +63,6 @@ build:windows --host_cxxopt="/std:c++20"
4263
startup --windows_enable_symlinks
4364
build:windows --enable_runfiles
4465

45-
4666
###############################################################################
4767
# Options for continuous integration.
4868
###############################################################################
@@ -71,17 +91,19 @@ build:ci --test_summary=terse
7191
# See e.g. https://github.com/bazelbuild/bazel/issues/18694.
7292
build:ci --remote_default_exec_properties=cache-silo-key=CleverPeafowl
7393

74-
# Put user-specific options in .bazelrc.user
75-
try-import %workspace%/.bazelrc.user
76-
77-
# Enable absl::string_view support in @googletest
78-
build --define absl=1
94+
###############################################################################
95+
# Options for asan.
96+
################################################################################
7997

80-
# asan
8198
build:asan --strip=never
8299
build:asan --copt -fsanitize=address
83100
build:asan --copt -DADDRESS_SANITIZER
84101
build:asan --copt -O1
85102
build:asan --copt -g
86103
build:asan --copt -fno-omit-frame-pointer
87104
build:asan --linkopt -fsanitize=address
105+
106+
###############################################################################
107+
# Put user-specific options in .bazelrc.user
108+
################################################################################
109+
try-import %workspace%/.bazelrc.user

0 commit comments

Comments
 (0)