Skip to content

Commit 16eca75

Browse files
committed
EXP: [C++] Require C++20
1 parent 7f645d4 commit 16eca75

File tree

41 files changed

+232
-138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+232
-138
lines changed

.github/workflows/cpp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ jobs:
290290
include:
291291
- os: windows-2022
292292
simd-level: AVX2
293-
title: AMD64 Windows 2022 AVX2
293+
title: AMD64 Windows 2022 C++20 AVX2
294294
env:
295295
ARROW_BOOST_USE_SHARED: OFF
296296
ARROW_BUILD_BENCHMARKS: ON
@@ -317,7 +317,7 @@ jobs:
317317
ARROW_WITH_ZLIB: ON
318318
ARROW_WITH_ZSTD: ON
319319
BOOST_SOURCE: BUNDLED
320-
CMAKE_CXX_STANDARD: "17"
320+
CMAKE_CXX_STANDARD: "20"
321321
CMAKE_GENERATOR: Ninja
322322
CMAKE_INSTALL_LIBDIR: bin
323323
CMAKE_INSTALL_PREFIX: /usr

.github/workflows/r.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,13 @@ jobs:
286286
# static library. The R is not used here but R 4.1 was the last R to use
287287
# Rtools40.
288288
r-version: "4.1"
289-
rtools-version: 40
289+
rtools-version: ${{ matrix.config.rtools }}
290290
Ncpus: 2
291291
- name: Build Arrow C++
292292
shell: bash
293293
env:
294294
MINGW_ARCH: ${{ matrix.config.arch }}
295+
RTOOLS_VERSION: ${{ matrix.config.rtools }}
295296
run: ci/scripts/r_windows_build.sh
296297
- name: Rename libarrow.zip
297298
# So that they're unique when multiple are downloaded in the next step

.github/workflows/ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ jobs:
349349
ARROW_WITH_SNAPPY: ON
350350
ARROW_WITH_ZLIB: ON
351351
ARROW_WITH_ZSTD: ON
352-
CMAKE_CXX_STANDARD: "17"
352+
CMAKE_CXX_STANDARD: "20"
353353
CMAKE_GENERATOR: Ninja
354354
CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/dist"
355355
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'

c_glib/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ project(
2121
'arrow-glib',
2222
'c',
2323
'cpp',
24-
default_options: ['c_std=c99', 'cpp_std=c++17'],
24+
default_options: ['c_std=c99', 'cpp_std=c++20'],
2525
license: 'Apache-2.0',
2626
# Debian:
2727
# https://packages.debian.org/search?keywords=meson

ci/appveyor-cpp-build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ cmake -G "%GENERATOR%" %ARROW_CMAKE_ARGS% ^
9393
-DARROW_WITH_ZSTD=ON ^
9494
-DCMAKE_BUILD_TYPE="Release" ^
9595
-DCMAKE_CXX_FLAGS_RELEASE="/MD /Od /UNDEBUG" ^
96-
-DCMAKE_CXX_STANDARD=17 ^
96+
-DCMAKE_CXX_STANDARD=20 ^
9797
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
9898
-DCMAKE_UNITY_BUILD=ON ^
9999
-DCMAKE_VERBOSE_MAKEFILE=OFF ^

ci/docker/centos-7-cpp.dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN sed -i \
2525
-e 's/mirror\.centos\.org/vault.centos.org/' \
2626
/etc/yum.repos.d/*.repo
2727

28-
# devtoolset is required for C++17
28+
# devtoolset is required for C++20
2929
RUN \
3030
yum install -y \
3131
centos-release-scl \
@@ -38,7 +38,8 @@ RUN \
3838
/etc/yum.repos.d/CentOS-SCLo-scl*.repo && \
3939
yum install -y \
4040
curl \
41-
devtoolset-8 \
41+
devtoolset-11-gcc-c++ \
42+
devtoolset-11-make \
4243
diffutils \
4344
gcc-c++ \
4445
libcurl-devel \

ci/scripts/cpp_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ elif [ "${ARROW_EMSCRIPTEN:-OFF}" = "ON" ]; then
167167
-DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE:-OFF} \
168168
-DCMAKE_C_FLAGS="${CFLAGS:-}" \
169169
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-}" \
170-
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-17}" \
170+
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-20}" \
171171
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR:-lib} \
172172
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}} \
173173
-DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \
@@ -255,7 +255,7 @@ else
255255
-DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE:-OFF} \
256256
-DCMAKE_C_FLAGS="${CFLAGS:-}" \
257257
-DCMAKE_CXX_FLAGS="${CXXFLAGS:-}" \
258-
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-17}" \
258+
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD:-20}" \
259259
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR:-lib} \
260260
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ARROW_HOME}} \
261261
-DCMAKE_UNITY_BUILD=${CMAKE_UNITY_BUILD:-OFF} \

ci/scripts/r_windows_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mv mingw* build
4444
cd build
4545

4646
# This may vary by system/CI provider
47-
MSYS_LIB_DIR="/c/rtools40"
47+
MSYS_LIB_DIR="/c/rtools${RTOOLS_VERSION}"
4848

4949
# Untar the builds we made
5050
ls *.xz | xargs -n 1 tar -xJf

cpp/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARROW_CXXFLAGS}")
625625
# C++ specific flags.
626626
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_COMMON_FLAGS} ${ARROW_CXXFLAGS}")
627627

628-
# Remove --std=c++17 to avoid errors from C compilers
629-
string(REPLACE "-std=c++17" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
628+
# Remove -std=c++20 to avoid errors from C compilers
629+
string(REPLACE "-std=c++20" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
630630

631-
# Add C++-only flags, like -std=c++17
631+
# Add C++-only flags, like -std=c++20
632632
set(CMAKE_CXX_FLAGS "${CXX_ONLY_FLAGS} ${CMAKE_CXX_FLAGS}")
633633

634634
# ASAN / TSAN / UBSAN

cpp/cmake_modules/GandivaAddBitcode.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# Create bitcode for the given source file.
1919
function(gandiva_add_bitcode SOURCE)
20-
set(CLANG_OPTIONS -std=c++17)
20+
set(CLANG_OPTIONS -std=c++20)
2121
if(MSVC)
2222
# "19.20" means that it's compatible with Visual Studio 16 2019.
2323
# We can update this to "19.30" when we dropped support for Visual

0 commit comments

Comments
 (0)