diff --git a/.bazelrc b/.bazelrc index 2ae57e6..01cafaf 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,17 +1,41 @@ # Enable logging rc options. common --announce_rc -# Enable verbose failures for testing only. -build --verbose_failures +############################################################################### +# Global options for building Pybind11_Abseil. +############################################################################### -# Set the default Apple platform to macOS. -build --apple_platform_type=macos +# Fix the python version +build --@rules_python//python/config_settings:python_version=3.12 -# Abseil requires C++14 at minimum. +############################################################################### +# 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 + +############################################################################### +# 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 --host_cxxopt=-std=c++17 +# 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 + +############################################################################### +# Options for Windows. +############################################################################### + build:windows --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 # Enable the runfiles symlink tree on Windows. This makes it possible to build @@ -21,9 +45,32 @@ build:windows --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 startup --windows_enable_symlinks build:windows --enable_runfiles -# Enable logging error output. -test --test_output=errors -test --test_summary=detailed +############################################################################### +# Options for continuous integration. +############################################################################### -# https://bazel.build/configure/best-practices#bazelrc-file +# All build options also apply to test as described by the "Option precedence" +# section in https://bazel.build/run/bazelrc#bazelrc-syntax-semantics. + +# 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. +test:ci --test_output=errors + +# Skip tests that are too large to run on CI. +test:ci --test_tag_filters=-noci + +# Print information only about tests executed +test:ci --test_summary=short + +############################################################################### +# Put user-specific options in user.bazelrc +# See https://bazel.build/configure/best-practices#bazelrc-file +################################################################################ try-import %workspace%/user.bazelrc diff --git a/MODULE.bazel b/MODULE.bazel index 64ccc9c..281639e 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,16 +6,17 @@ module( # Only direct dependencies need to be listed below. # Please keep the versions in sync with the versions in the WORKSPACE file. # see https://registry.bazel.build/ -bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "bazel_skylib", version = "1.8.2") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "rules_cc", version = "0.2.9") +bazel_dep(name = "rules_python", version = "1.6.3") bazel_dep(name = "abseil-cpp", version = "20240722.1", repo_name = "com_google_absl") -bazel_dep(name = "platforms", version = "0.0.10") -bazel_dep(name = "rules_cc", version = "0.1.1") -bazel_dep(name = "rules_python", version = "0.40.0") -bazel_dep(name = "pybind11_bazel", version = "2.13.6") +bazel_dep(name = "pybind11_bazel", version = "3.0.0") #### DEV ONLY DEPENDENCIES BELOW HERE #### SUPPORTED_PYTHON_VERSIONS = [ + "3.13", "3.12", "3.11", "3.10", @@ -23,7 +24,7 @@ SUPPORTED_PYTHON_VERSIONS = [ "3.8", ] -DEFAULT_PYTHON = "3.11" +DEFAULT_PYTHON = "3.12" python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)