mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 21:15:45 +00:00
Centralize Shardok C++ standard settings (#8197)
This commit is contained in:
@@ -14,6 +14,7 @@ common --worker_sandboxing
|
||||
common --local_test_jobs=64
|
||||
common --jobs=64
|
||||
|
||||
# Keep these C++ standard flags in sync with tools/copts.bzl and scripts/shardok_cpp_config.sh.
|
||||
common --cxxopt="--std=c++23"
|
||||
common --cxxopt="-Wno-deprecated-non-prototype"
|
||||
common --per_file_copt=src/test/cpp/.*@-Wno-character-conversion
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(git rev-parse --show-toplevel)"
|
||||
source "$repo_root/scripts/shardok_cpp_config.sh"
|
||||
|
||||
files=(
|
||||
"src/main/cpp/net/eagle0/shardok/library/ActionCost.hpp"
|
||||
@@ -15,7 +16,7 @@ files=(
|
||||
|
||||
compiler_args=(
|
||||
"-I$repo_root"
|
||||
"-std=c++23"
|
||||
"$SHARDOK_CXX_STANDARD_ARG"
|
||||
)
|
||||
|
||||
if command -v xcrun >/dev/null 2>&1; then
|
||||
|
||||
@@ -10,13 +10,14 @@ set -e
|
||||
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
|
||||
|
||||
repo_root="$(git rev-parse --show-toplevel)"
|
||||
source "$repo_root/scripts/shardok_cpp_config.sh"
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "Usage: scripts/run-clang-tidy.sh [clang-tidy args] <files> [-- <compiler args>]"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " scripts/run-clang-tidy.sh --verify-config"
|
||||
echo " scripts/run-clang-tidy.sh src/main/cpp/net/eagle0/shardok/library/CombatDamage.hpp -- -I$repo_root -std=c++23"
|
||||
echo " scripts/run-clang-tidy.sh src/main/cpp/net/eagle0/shardok/library/CombatDamage.hpp -- -I$repo_root $SHARDOK_CXX_STANDARD_ARG"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Shared C++ settings for shell scripts that invoke Shardok tooling outside Bazel.
|
||||
|
||||
SHARDOK_CXX_STANDARD="c++23"
|
||||
SHARDOK_CXX_STANDARD_ARG="-std=${SHARDOK_CXX_STANDARD}"
|
||||
+11
-1
@@ -1,4 +1,14 @@
|
||||
# Suppress -Wdeprecated-copy-with-dtor after -Wdeprecated due to protobuf 32.x warning
|
||||
COPTS = ["--std=c++23", "-Werror", "-Wall", "-Wextra", "-Wdeprecated", "-Wno-deprecated-copy-with-dtor"]
|
||||
CXX_STANDARD = "c++23"
|
||||
CXX_STANDARD_COPT = "--std=" + CXX_STANDARD
|
||||
|
||||
COPTS = [
|
||||
CXX_STANDARD_COPT,
|
||||
"-Werror",
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wdeprecated",
|
||||
"-Wno-deprecated-copy-with-dtor",
|
||||
]
|
||||
|
||||
TEST_COPTS = COPTS + ["-Iexternal/gtest/include"]
|
||||
|
||||
Reference in New Issue
Block a user