2023-02-01 19:16:44 +03:00
|
|
|
# Enable configurations specific to the host platform.
|
|
|
|
common --enable_platform_specific_config
|
|
|
|
|
2023-01-09 19:28:47 +03:00
|
|
|
# Disallow empty `glob()`s.
|
|
|
|
build --incompatible_disallow_empty_glob
|
|
|
|
|
|
|
|
# Don't auto-detect the C/C++ toolchain.
|
|
|
|
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
|
|
|
|
|
|
|
|
# Use platforms to select toolchains.
|
|
|
|
# See https://bazel.build/concepts/platforms#cxx and
|
|
|
|
# https://github.com/bazelbuild/bazel/issues/7260.
|
|
|
|
build --incompatible_enable_cc_toolchain_resolution
|
|
|
|
|
2023-01-09 22:02:35 +03:00
|
|
|
# Disable transitions.
|
|
|
|
# See https://github.com/bazelbuild/rules_docker/issues/2052.
|
|
|
|
build --@io_bazel_rules_docker//transitions:enable=false
|
|
|
|
|
2023-01-09 20:42:51 +03:00
|
|
|
# Add aliases for compiler version build settings.
|
|
|
|
build --flag_alias=clang_version=//:clang_version
|
|
|
|
build --flag_alias=gcc_version=//:gcc_version
|
|
|
|
|
2023-06-23 00:53:13 +03:00
|
|
|
# Use optimized build by default. According to the bazel documentation, this
|
|
|
|
# corresponds to -O2 -DNDEBUG, but these are overriden in
|
|
|
|
# //bazel/common_settings.bzl:vere_library.
|
|
|
|
# https://bazel.build/docs/user-manual#build-semantics
|
|
|
|
build --compilation_mode=opt
|
|
|
|
|
2023-02-01 19:16:44 +03:00
|
|
|
# Don't include source level debug info on macOS. See
|
|
|
|
# https://github.com/urbit/urbit/issues/5561 and
|
|
|
|
# https://github.com/urbit/vere/issues/131.
|
|
|
|
build:linux --host_copt='-g'
|
2023-01-12 21:57:44 +03:00
|
|
|
build --strip=never
|
|
|
|
|
2023-06-23 00:53:13 +03:00
|
|
|
# Turn on optimization, CPU and memory debug for exec config, which we only use
|
|
|
|
# to run the fake ship tests. Also turn on extra snapshot validation.
|
2023-01-31 20:21:23 +03:00
|
|
|
build --host_copt='-O3'
|
|
|
|
build --host_copt='-DU3_CPU_DEBUG'
|
|
|
|
build --host_copt='-DU3_MEMORY_DEBUG'
|
2023-02-17 22:43:32 +03:00
|
|
|
build --host_copt='-DC3DBG'
|
2023-06-02 18:47:28 +03:00
|
|
|
build --host_copt='-DU3_SNAPSHOT_VALIDATION'
|
2023-01-09 22:02:35 +03:00
|
|
|
|
2023-02-17 01:02:16 +03:00
|
|
|
# Set as per-file copts as a plain --copt gets passed to third party
|
|
|
|
# dependencies which forces recompilation (slow) if you are switching between
|
2023-05-10 19:17:22 +03:00
|
|
|
# including/excluding a symbol define.
|
2023-02-17 01:02:16 +03:00
|
|
|
build:mem_dbg --per_file_copt='pkg/.*@-DU3_MEMORY_DEBUG'
|
|
|
|
build:cpu_dbg --per_file_copt='pkg/.*@-DU3_CPU_DEBUG'
|
2023-06-02 18:47:28 +03:00
|
|
|
build:snp_dbg --per_file_copt='pkg/.*@-DU3_SNAPSHOT_VALIDATION'
|
2023-02-17 01:02:16 +03:00
|
|
|
|
2023-01-09 19:28:47 +03:00
|
|
|
# Any personal configuration should go in .user.bazelrc.
|
|
|
|
try-import %workspace%/.user.bazelrc
|