Skip to content

Commit fc75e83

Browse files
rwgkcopybara-github
authored andcommitted
Add C++20 testing, remove C++14 testing.
Secondary changes: * pybind11 needs to be pinned to a version right before pybind/pybind11#4786 was merged, to avoid `ctest` `permission denied` errors (to be debugged separately). * `find_package(PythonLibs REQUIRED)` is removed. It is deprecated (https://github.com/pybind/pybind11/blob/master/docs/faq.rst) and evidently not needed. * More complete logging. PiperOrigin-RevId: 595435856
1 parent 67491a4 commit fc75e83

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ set(BUILD_TESTING OFF)
1212
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
1313
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
1414

15-
find_package(PythonLibs REQUIRED)
16-
1715
FetchContent_Declare(
1816
abseil-cpp
1917
URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
@@ -22,7 +20,7 @@ FetchContent_Declare(
2220

2321
FetchContent_Declare(
2422
pybind11
25-
URL https://github.com/pybind/pybind11/archive/refs/heads/master.tar.gz)
23+
URL https://github.com/pybind/pybind11/archive/7d538a42750c8580eeaac10e505840a3694b04c8.tar.gz)
2624

2725
FetchContent_MakeAvailable(abseil-cpp pybind11)
2826

scripts/build_and_run_tests_bazel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# - builds and runs tests
77

88
set -e # exit when any command fails
9-
# set -x # Prints all executed command
9+
set -x # Prints all executed commands
1010

1111
MYDIR="$(dirname "$(realpath "$0")")"
1212

@@ -80,5 +80,5 @@ export PYTHON_LIB_PATH=`python3 -c "import sysconfig; print(sysconfig.get_path('
8080
echo "Using PYTHON_BIN_PATH: $PYTHON_BIN_PATH"
8181
echo "Using PYTHON_LIB_PATH: $PYTHON_LIB_PATH"
8282

83-
BAZEL_CXXOPTS="-std=c++14" bazel test ... --test_output=errors "$@"
8483
BAZEL_CXXOPTS="-std=c++17" bazel test ... --test_output=errors "$@"
84+
BAZEL_CXXOPTS="-std=c++20" bazel test ... --test_output=errors "$@"

scripts/build_and_run_tests_cmake.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# - builds and runs tests
77

88
set -e # exit when any command fails
9-
# set -x # Prints all executed command
9+
set -x # Prints all executed commands
1010

1111
MYDIR="$(dirname "$(realpath "$0")")"
1212

@@ -87,17 +87,17 @@ fi
8787
mkdir tmp_build
8888
cd tmp_build
8989

90-
# C++14
91-
cmake ../ -DCMAKE_CXX_STANDARD=14 -DCMAKE_VERBOSE_MAKEFILE=ON
90+
# C++17
91+
cmake ../ -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE=ON
9292
make "$@"
93-
ctest --output-on-failure
93+
ctest --output-on-failure --extra-verbose
9494

9595
rm -r ./*
9696

97-
# C++17
98-
cmake ../ -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE=ON
97+
# C++20
98+
cmake ../ -DCMAKE_CXX_STANDARD=20 -DCMAKE_VERBOSE_MAKEFILE=ON
9999
make "$@"
100-
ctest --output-on-failure
100+
ctest --output-on-failure --extra-verbose
101101

102102
cd ../
103103
rm -r tmp_build

0 commit comments

Comments
 (0)