Commit fc75e83b by Ralf W. Grosse-Kunstleve Committed by Copybara-Service

Add C++20 testing, remove C++14 testing.

Secondary changes:

* pybind11 needs to be pinned to a version right before https://github.com/pybind/pybind11/pull/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
parent 67491a41
......@@ -12,8 +12,6 @@ set(BUILD_TESTING OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
find_package(PythonLibs REQUIRED)
FetchContent_Declare(
abseil-cpp
URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
......@@ -22,7 +20,7 @@ FetchContent_Declare(
FetchContent_Declare(
pybind11
URL https://github.com/pybind/pybind11/archive/refs/heads/master.tar.gz)
URL https://github.com/pybind/pybind11/archive/7d538a42750c8580eeaac10e505840a3694b04c8.tar.gz)
FetchContent_MakeAvailable(abseil-cpp pybind11)
......
......@@ -6,7 +6,7 @@
# - builds and runs tests
set -e # exit when any command fails
# set -x # Prints all executed command
set -x # Prints all executed commands
MYDIR="$(dirname "$(realpath "$0")")"
......@@ -80,5 +80,5 @@ export PYTHON_LIB_PATH=`python3 -c "import sysconfig; print(sysconfig.get_path('
echo "Using PYTHON_BIN_PATH: $PYTHON_BIN_PATH"
echo "Using PYTHON_LIB_PATH: $PYTHON_LIB_PATH"
BAZEL_CXXOPTS="-std=c++14" bazel test ... --test_output=errors "$@"
BAZEL_CXXOPTS="-std=c++17" bazel test ... --test_output=errors "$@"
BAZEL_CXXOPTS="-std=c++20" bazel test ... --test_output=errors "$@"
......@@ -6,7 +6,7 @@
# - builds and runs tests
set -e # exit when any command fails
# set -x # Prints all executed command
set -x # Prints all executed commands
MYDIR="$(dirname "$(realpath "$0")")"
......@@ -87,17 +87,17 @@ fi
mkdir tmp_build
cd tmp_build
# C++14
cmake ../ -DCMAKE_CXX_STANDARD=14 -DCMAKE_VERBOSE_MAKEFILE=ON
# C++17
cmake ../ -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE=ON
make "$@"
ctest --output-on-failure
ctest --output-on-failure --extra-verbose
rm -r ./*
# C++17
cmake ../ -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE=ON
# C++20
cmake ../ -DCMAKE_CXX_STANDARD=20 -DCMAKE_VERBOSE_MAKEFILE=ON
make "$@"
ctest --output-on-failure
ctest --output-on-failure --extra-verbose
cd ../
rm -r tmp_build
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment