rework .bazelrc
This commit is contained in:
93
.bazelrc
93
.bazelrc
@@ -1,40 +1,60 @@
|
||||
# Enable logging rc options.
|
||||
common --announce_rc
|
||||
|
||||
# ----CONFIG OPTIONS----
|
||||
###############################################################################
|
||||
# Global options for building OR-Tools.
|
||||
###############################################################################
|
||||
|
||||
build --flag_alias=with_bop=//ortools/linear_solver:with_bop
|
||||
build --flag_alias=with_cbc=//ortools/linear_solver:with_cbc
|
||||
build --flag_alias=with_clp=//ortools/linear_solver:with_clp
|
||||
build --flag_alias=with_cp_sat=//ortools/linear_solver:with_cp_sat
|
||||
build --flag_alias=with_cplex=//ortools/linear_solver:with_cplex
|
||||
build --flag_alias=with_glop=//ortools/linear_solver:with_glop
|
||||
build --flag_alias=with_glpk=//ortools/linear_solver:with_glpk
|
||||
build --flag_alias=with_highs=//ortools/linear_solver:with_highs
|
||||
build --flag_alias=with_pdlp=//ortools/linear_solver:with_pdlp
|
||||
build --flag_alias=with_scip=//ortools/linear_solver:with_scip
|
||||
|
||||
build --flag_alias=with_cplex=//ortools/linear_solver:with_cplex
|
||||
build --flag_alias=with_xpress=//ortools/linear_solver:with_xpress
|
||||
|
||||
# Sets the default Apple platform to macOS.
|
||||
build --apple_platform_type=macos
|
||||
|
||||
# By default, build OR-Tools in C++ 17 mode, with various extra flags per
|
||||
# platform.
|
||||
build --enable_platform_specific_config
|
||||
# Enable absl::string_view support in @googletest
|
||||
build --define absl=1
|
||||
|
||||
# Fix the python version
|
||||
build --@rules_python//python/config_settings:python_version=3.12
|
||||
|
||||
# Per platform parameters.
|
||||
build:linux --cxxopt="-std=c++17" --cxxopt=-Wno-sign-compare
|
||||
build:linux --host_cxxopt="-std=c++17" --host_cxxopt=-Wno-sign-compare
|
||||
###############################################################################
|
||||
# Per plaform options
|
||||
###############################################################################
|
||||
|
||||
# By default, build with various extra flags per platform.
|
||||
build --enable_platform_specific_config
|
||||
|
||||
###############################################################################
|
||||
# Options for Linux.
|
||||
###############################################################################
|
||||
|
||||
build:linux --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
|
||||
build:linux --cxxopt=-Wno-sign-compare --host_cxxopt=-Wno-sign-compare
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Options for macOS.
|
||||
###############################################################################
|
||||
|
||||
# Sets the default Apple platform to macOS.
|
||||
build --apple_platform_type=macos
|
||||
build:macos --features=-supports_dynamic_linker
|
||||
build:macos --cxxopt="-std=c++17" --cxxopt=-Wno-sign-compare --cxxopt=-mmacos-version-min=10.15 --cxxopt=-Wno-dangling-field
|
||||
build:macos --host_cxxopt="-std=c++17" --host_cxxopt=-Wno-sign-compare --host_cxxopt=-mmacos-version-min=10.15 --host_cxxopt=-Wno-dangling-field
|
||||
build:macos --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
|
||||
build:macos --cxxopt=-Wno-sign-compare --host_cxxopt=-Wno-sign-compare
|
||||
build:macos --cxxopt=-Wno-dangling-field --host_cxxopt=-Wno-dangling-field
|
||||
build:macos --cxxopt=-mmacos-version-min=10.15 --host_cxxopt=-mmacos-version-min=10.15
|
||||
|
||||
build:windows --cxxopt="/std:c++20"
|
||||
build:windows --host_cxxopt="/std:c++20"
|
||||
###############################################################################
|
||||
# Options for Windows.
|
||||
###############################################################################
|
||||
|
||||
build:windows --cxxopt=/std:c++20 --host_cxxopt=/std:c++20
|
||||
|
||||
# Enable the runfiles symlink tree on Windows. This makes it possible to build
|
||||
# the pip package on Windows without an intermediate data-file archive, as the
|
||||
@@ -43,16 +63,38 @@ build:windows --host_cxxopt="/std:c++20"
|
||||
startup --windows_enable_symlinks
|
||||
build:windows --enable_runfiles
|
||||
|
||||
# Print command lines for build commands.
|
||||
# build --subcommands=pretty_print
|
||||
###############################################################################
|
||||
# Options for continuous integration.
|
||||
###############################################################################
|
||||
|
||||
# Print test logs for failed tests.
|
||||
test --test_output=errors --test_timeout_filters=-eternal
|
||||
# All build options also apply to test as described by the "Option precedence"
|
||||
# section in https://bazel.build/run/bazelrc#bazelrc-syntax-semantics.
|
||||
|
||||
# Put user-specific options in .bazelrc.user
|
||||
try-import %workspace%/.bazelrc.user
|
||||
# Note for anybody considering using --compilation_mode=opt in CI, it builds
|
||||
# most files twice, one PIC version for shared libraries in tests, and one
|
||||
# non-PIC version for binaries.
|
||||
build:ci --copt=-O1
|
||||
|
||||
# Show as many errors as possible.
|
||||
build:ci --keep_going
|
||||
|
||||
# Show test errors.
|
||||
build:ci --test_output=errors
|
||||
|
||||
# Override timeout for tests
|
||||
build:ci --test_timeout_filters=-eternal
|
||||
|
||||
# Only show failing tests to reduce output
|
||||
build:ci --test_summary=terse
|
||||
|
||||
# Attempt to work around intermittent issue while trying to fetch remote blob.
|
||||
# See e.g. https://github.com/bazelbuild/bazel/issues/18694.
|
||||
build:ci --remote_default_exec_properties=cache-silo-key=CleverPeafowl
|
||||
|
||||
###############################################################################
|
||||
# Options for asan.
|
||||
################################################################################
|
||||
|
||||
# asan
|
||||
build:asan --strip=never
|
||||
build:asan --copt -fsanitize=address
|
||||
build:asan --copt -DADDRESS_SANITIZER
|
||||
@@ -60,3 +102,8 @@ build:asan --copt -O1
|
||||
build:asan --copt -g
|
||||
build:asan --copt -fno-omit-frame-pointer
|
||||
build:asan --linkopt -fsanitize=address
|
||||
|
||||
###############################################################################
|
||||
# Put user-specific options in .bazelrc.user
|
||||
################################################################################
|
||||
try-import %workspace%/.bazelrc.user
|
||||
|
||||
Reference in New Issue
Block a user