aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskanev <skanev@google.com>2023-10-11 12:52:32 -0700
committerSvilen Kanev <svilen.kanev@gmail.com>2023-10-12 10:08:16 -0700
commita76986de7ec8961875a54867fe6e875877635824 (patch)
treed97692473b9bd8c7c12f0dab244b25521ca431b0
parentb665ecebcb0f14988408036422ac114cade65a7c (diff)
downloadperf_data_converter-a76986de7ec8961875a54867fe6e875877635824.tar.gz
Add a .bazelrc file with -std=c++17, which is shared between Github CI, and internal test-with-upstream CI.
Previously, the flag was set only on internal test-with-upstream CI with an environment variable. Now it should be set both places with the .bazelrc. PiperOrigin-RevId: 572659426
-rw-r--r--.bazelrc2
-rwxr-xr-xci/linux_clang-latest_libcxx_bazel.sh6
2 files changed, 3 insertions, 5 deletions
diff --git a/.bazelrc b/.bazelrc
new file mode 100644
index 0000000..1c5fa8f
--- /dev/null
+++ b/.bazelrc
@@ -0,0 +1,2 @@
+# Require c++17 for c++ files.
+build --cxxopt='-std=c++17'
diff --git a/ci/linux_clang-latest_libcxx_bazel.sh b/ci/linux_clang-latest_libcxx_bazel.sh
index ad5bab9..6078444 100755
--- a/ci/linux_clang-latest_libcxx_bazel.sh
+++ b/ci/linux_clang-latest_libcxx_bazel.sh
@@ -11,10 +11,6 @@ if [ -z "${PDC_ROOT:-}" ]; then
PDC_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z "${STD:-}" ]; then
- STD="c++17"
-fi
-
# This container is a reasonable start but is missing some prerequisite libs and
# an installation of linux_perf. We'll manually add them below.
readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210617"
@@ -26,7 +22,7 @@ time docker run \
--rm \
-i \
-e CC="/opt/llvm/clang/bin/clang" \
- -e BAZEL_CXXOPTS="-std=${STD}:-nostdinc++" \
+ -e BAZEL_CXXOPTS="-nostdinc++" \
-e BAZEL_LINKOPTS="-L/opt/llvm/libcxx/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx/lib" \
-e CPLUS_INCLUDE_PATH="/opt/llvm/libcxx/include/c++/v1" \
${DOCKER_EXTRA_ARGS:-} \