diff --git a/.github/workflows/bazel_linux.yml b/.github/workflows/bazel_linux.yml index 87d1b133fd..187edce4d5 100644 --- a/.github/workflows/bazel_linux.yml +++ b/.github/workflows/bazel_linux.yml @@ -23,6 +23,6 @@ jobs: sudo apt-get install bazel bazel --version - name: Build - run: bazel build --cxxopt=-std=c++17 //...:all + run: bazel build --cxxopt=-std=c++20 //...:all - name: Test - run: bazel test --cxxopt=-std=c++17 //...:all + run: bazel test --cxxopt=-std=c++20 //...:all diff --git a/.github/workflows/bazel_macos.yml b/.github/workflows/bazel_macos.yml index 16dcfebac7..63f8d6e0c5 100644 --- a/.github/workflows/bazel_macos.yml +++ b/.github/workflows/bazel_macos.yml @@ -19,6 +19,6 @@ jobs: #brew install bazel bazel --version - name: Build - run: bazel build --cxxopt=-std=c++17 //...:all + run: bazel build --cxxopt=-std=c++20 //...:all - name: Test - run: bazel test --cxxopt=-std=c++17 //...:all + run: bazel test --cxxopt=-std=c++20 //...:all diff --git a/bazel/README.md b/bazel/README.md index e41e13e392..7ed7e12bdd 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -53,15 +53,15 @@ OR-Tools depends on severals mandatory libraries. ## Compilation -You must compile OR-Tools using C++17: +You must compile OR-Tools using C++20: * on UNIX: ```sh - bazel build --cxxopt=-std=c++17 //...:all + bazel build --cxxopt=-std=c++20 //...:all ``` * on Windows when using MSVC: ```sh - bazel build --cxxopt="-std:c++17" //...:all + bazel build --cxxopt="-std:c++20" //...:all ``` ## Testing @@ -70,11 +70,11 @@ You may run tests using: * on UNIX: ```sh - bazel test --cxxopt=-std=c++17 //...:all + bazel test --cxxopt=-std=c++20 //...:all ``` * on Windows when using MSVC: ```sh - bazel test --cxxopt="-std:c++17" //...:all + bazel test --cxxopt="-std:c++20" //...:all ``` ## Integration diff --git a/bazel/docker/alpine/Dockerfile b/bazel/docker/alpine/Dockerfile index c00a40de85..497d3f42aa 100644 --- a/bazel/docker/alpine/Dockerfile +++ b/bazel/docker/alpine/Dockerfile @@ -23,7 +23,7 @@ COPY . . FROM devel AS build RUN bazel version -RUN bazel build --curses=no --host_javabase=@local_jdk//:jdk --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel build --curses=no --host_javabase=@local_jdk//:jdk --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all FROM build AS test -RUN bazel test --curses=no --host_javabase=@local_jdk//:jdk --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel test --curses=no --host_javabase=@local_jdk//:jdk --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all diff --git a/bazel/docker/archlinux/Dockerfile b/bazel/docker/archlinux/Dockerfile index ed394cc4e2..bf5ce4234e 100644 --- a/bazel/docker/archlinux/Dockerfile +++ b/bazel/docker/archlinux/Dockerfile @@ -12,7 +12,7 @@ COPY . . FROM devel AS build RUN bazel version -RUN bazel build --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel build --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all FROM build AS test -RUN bazel test -c opt --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel test -c opt --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all diff --git a/bazel/docker/centos/Dockerfile b/bazel/docker/centos/Dockerfile index fcc5dd3ec1..9c730947a4 100644 --- a/bazel/docker/centos/Dockerfile +++ b/bazel/docker/centos/Dockerfile @@ -23,7 +23,7 @@ COPY . . FROM devel AS build RUN bazel version -RUN bazel build --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel build --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all FROM build AS test -RUN bazel test -c opt --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel test -c opt --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all diff --git a/bazel/docker/debian/Dockerfile b/bazel/docker/debian/Dockerfile index f49e9d4162..788cecd5f9 100644 --- a/bazel/docker/debian/Dockerfile +++ b/bazel/docker/debian/Dockerfile @@ -24,7 +24,7 @@ COPY . . FROM devel AS build RUN bazel version -RUN bazel build --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel build --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all FROM build AS test -RUN bazel test -c opt --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel test -c opt --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all diff --git a/bazel/docker/fedora/Dockerfile b/bazel/docker/fedora/Dockerfile index 3af33d2757..1e24e82ee3 100644 --- a/bazel/docker/fedora/Dockerfile +++ b/bazel/docker/fedora/Dockerfile @@ -19,7 +19,7 @@ COPY . . FROM devel AS build RUN bazel version -RUN bazel build --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel build --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all FROM build AS test -RUN bazel test -c opt --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel test -c opt --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all diff --git a/bazel/docker/opensuse/Dockerfile b/bazel/docker/opensuse/Dockerfile index ffa65ec222..1f09743b77 100644 --- a/bazel/docker/opensuse/Dockerfile +++ b/bazel/docker/opensuse/Dockerfile @@ -15,7 +15,7 @@ COPY . . FROM devel AS build RUN bazel version -RUN bazel build --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel build --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all FROM build AS test -RUN bazel test -c opt --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel test -c opt --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all diff --git a/bazel/docker/ubuntu/Dockerfile b/bazel/docker/ubuntu/Dockerfile index af21e3dc8c..cf0efc583b 100644 --- a/bazel/docker/ubuntu/Dockerfile +++ b/bazel/docker/ubuntu/Dockerfile @@ -27,7 +27,7 @@ COPY . . FROM devel AS build RUN bazel version -RUN bazel build --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel build --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all FROM build AS test -RUN bazel test -c opt --curses=no --cxxopt=-std=c++17 --copt='-Wno-sign-compare' //...:all +RUN bazel test -c opt --curses=no --cxxopt=-std=c++20 --copt='-Wno-sign-compare' //...:all