2025-01-22 13:53:19 +01:00
|
|
|
# Enable logging rc options.
|
|
|
|
|
common --announce_rc
|
|
|
|
|
|
2025-09-16 15:14:39 +02:00
|
|
|
###############################################################################
|
|
|
|
|
# Global options for building OR-Tools.
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
2023-06-07 14:40:42 +02:00
|
|
|
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
|
2023-11-29 11:41:45 +01:00
|
|
|
build --flag_alias=with_cp_sat=//ortools/linear_solver:with_cp_sat
|
2025-09-16 15:14:39 +02:00
|
|
|
build --flag_alias=with_cplex=//ortools/linear_solver:with_cplex
|
2023-06-07 14:40:42 +02:00
|
|
|
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_xpress=//ortools/linear_solver:with_xpress
|
2023-06-21 17:30:30 +02:00
|
|
|
|
2025-09-16 15:14:39 +02:00
|
|
|
# Enable absl::string_view support in @googletest
|
|
|
|
|
build --define absl=1
|
2023-06-30 11:20:15 +02:00
|
|
|
|
2024-11-15 14:40:16 +01:00
|
|
|
# Fix the python version
|
|
|
|
|
build --@rules_python//python/config_settings:python_version=3.12
|
|
|
|
|
|
2025-09-16 15:14:39 +02:00
|
|
|
###############################################################################
|
|
|
|
|
# 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
|
2025-12-15 15:27:59 +01:00
|
|
|
build:linux --cxxopt=-Wno-range-loop-construct --host_cxxopt=-Wno-range-loop-construct
|
2025-09-16 15:14:39 +02:00
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
# Options for macOS.
|
|
|
|
|
###############################################################################
|
2024-11-15 14:40:16 +01:00
|
|
|
|
2025-09-16 15:14:39 +02:00
|
|
|
# Sets the default Apple platform to macOS.
|
|
|
|
|
build --apple_platform_type=macos
|
2024-11-15 14:40:16 +01:00
|
|
|
build:macos --features=-supports_dynamic_linker
|
2025-09-16 15:14:39 +02:00
|
|
|
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
|
2025-12-15 15:27:59 +01:00
|
|
|
build:macos --cxxopt=-Wno-range-loop-construct --host_cxxopt=-Wno-range-loop-construct
|
2025-09-16 15:14:39 +02:00
|
|
|
build:macos --cxxopt=-mmacos-version-min=10.15 --host_cxxopt=-mmacos-version-min=10.15
|
2024-11-15 14:40:16 +01:00
|
|
|
|
2025-09-16 15:14:39 +02:00
|
|
|
###############################################################################
|
|
|
|
|
# Options for Windows.
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
|
build:windows --cxxopt=/std:c++20 --host_cxxopt=/std:c++20
|
2024-02-07 16:30:01 -08:00
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
# build_pip_package script in its current form (as of Aug 2023) uses the
|
|
|
|
|
# runfiles symlink tree to decide what to put into the Python wheel.
|
|
|
|
|
startup --windows_enable_symlinks
|
|
|
|
|
build:windows --enable_runfiles
|
2023-06-29 11:02:05 +02:00
|
|
|
|
2025-09-16 15:14:39 +02:00
|
|
|
###############################################################################
|
|
|
|
|
# Options for continuous integration.
|
|
|
|
|
###############################################################################
|
2023-06-29 11:02:05 +02:00
|
|
|
|
2025-09-16 15:14:39 +02:00
|
|
|
# All build options also apply to test as described by the "Option precedence"
|
|
|
|
|
# section in https://bazel.build/run/bazelrc#bazelrc-syntax-semantics.
|
2023-06-29 11:02:05 +02:00
|
|
|
|
2025-09-16 15:14:39 +02:00
|
|
|
# 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
|
|
|
|
|
|
2025-10-07 07:44:40 +00:00
|
|
|
# Skip tests that are too large to run on CI.
|
2025-10-16 13:02:59 +02:00
|
|
|
build:ci --test_tag_filters=-noci
|
2025-09-16 15:14:39 +02:00
|
|
|
|
2025-10-07 07:44:40 +00:00
|
|
|
# Print information only about tests executed
|
|
|
|
|
build:ci --test_summary=short
|
2025-09-16 15:14:39 +02:00
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
################################################################################
|
2024-07-12 15:47:07 +02:00
|
|
|
|
|
|
|
|
build:asan --strip=never
|
|
|
|
|
build:asan --copt -fsanitize=address
|
|
|
|
|
build:asan --copt -DADDRESS_SANITIZER
|
|
|
|
|
build:asan --copt -O1
|
|
|
|
|
build:asan --copt -g
|
|
|
|
|
build:asan --copt -fno-omit-frame-pointer
|
|
|
|
|
build:asan --linkopt -fsanitize=address
|
2025-09-16 15:14:39 +02:00
|
|
|
|
|
|
|
|
###############################################################################
|
2025-09-22 17:22:22 +02:00
|
|
|
# Put user-specific options in user.bazelrc
|
|
|
|
|
# See https://bazel.build/configure/best-practices#bazelrc-file
|
2025-09-16 15:14:39 +02:00
|
|
|
################################################################################
|
2025-09-22 17:22:22 +02:00
|
|
|
try-import %workspace%/user.bazelrc
|