Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ project(s2-geometry
VERSION 0.12.0)

include(CMakeDependentOption)
include(CheckCXXCompilerFlag)
include(FeatureSummary)
include(FetchContent)
include(FindPackageHandleStandardArgs)
Expand Down Expand Up @@ -123,19 +122,21 @@ else()
# util/math/vector.h:178:16: warning: optimization attribute on
# ‘double sqrt(double)’ follows definition but the attribute doesn’t
# match [-Wattributes]
add_definitions(-Wno-attributes)
add_definitions(-Wno-deprecated-declarations)
add_definitions(-Wno-nullability-completeness)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-attributes>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-declarations>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-sign-compare>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-nullability-completeness>)
# Suppress noisy AArch64 ABI notes about parameter passing changes in
Comment thread
abhinavgautam01 marked this conversation as resolved.
# GCC 10.1. Irrelevant since we don't mix objects from old compilers.
# TODO: Use check_cxx_compiler_flag(-Wno-psabi) to guard this.
Comment thread
abhinavgautam01 marked this conversation as resolved.
add_compile_options(-Wno-psabi)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-psabi>)
# Some files use sized deallocation, which should be enabled by
# default for C++14 and later. There appears to be a bug with clang
# < 19 causing this not to be enabled.
# https://github.com/google/s2geometry/issues/411#issuecomment-2726949607
# This can be removed when clang19 is the minimum supported version.
add_compile_options(-fsized-deallocation)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>)
endif()
endif()

# If OpenSSL is installed in a non-standard location, configure with
Expand Down
20 changes: 19 additions & 1 deletion src/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,28 @@ common --enable_bzlmod
common --cxxopt=-std=c++20
common --announce_rc

# C++ warning flags for non-MSVC toolchains. Keep in line with CMakeLists.txt.
# `bazel test --config=ci` uses `build:ci --config=gcc` (Linux CI). For local
# macOS / Clang builds, pass `--config=clang` in addition to your other flags.

# Host GCC (Linux CI).
build:gcc --cxxopt=-Wno-attributes
Comment thread
abhinavgautam01 marked this conversation as resolved.
build:gcc --cxxopt=-Wno-deprecated-declarations
build:gcc --cxxopt=-Wno-sign-compare
build:gcc --cxxopt=-Wno-psabi

# Clang (e.g. macOS).
build:clang --cxxopt=-Wno-attributes
build:clang --cxxopt=-Wno-deprecated-declarations
build:clang --cxxopt=-Wno-sign-compare
build:clang --cxxopt=-Wno-nullability-completeness
build:clang --cxxopt=-fsized-deallocation

# Faster tests than fastbuild (-O0).
build:dev --copt=-O1

# CI-specific flags
# CI-specific flags.
common:ci --color=yes
build:ci --config=gcc
build:ci --show_progress_rate_limit=10
test:ci --test_output=errors