Centralize C++ version in Makefiles (#2713)

This commit is contained in:
Andrew Gaul
2025-08-30 16:49:51 +09:00
committed by GitHub
parent 1366f582b1
commit ff2080a39e
5 changed files with 8 additions and 5 deletions

View File

@ -143,7 +143,7 @@ jobs:
- name: Build
run: |
./autogen.sh
PKG_CONFIG_PATH=/usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig ./configure CXXFLAGS='-std=c++14'
PKG_CONFIG_PATH=/usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig ./configure
make --jobs=$(sysctl -n hw.ncpu)
- name: Cppcheck

View File

@ -38,7 +38,7 @@ clang-tidy:
cppcheck:
cppcheck --quiet --error-exitcode=1 \
--inline-suppr \
--std=c++14 \
--std=@CPP_VERSION@ \
--xml \
-D HAVE_ATTR_XATTR_H \
-D HAVE_SYS_EXTATTR_H \

View File

@ -34,7 +34,10 @@ AC_CHECK_HEADERS([attr/xattr.h])
AC_CHECK_HEADERS([sys/extattr.h])
AC_CHECK_FUNCS([fallocate])
CXXFLAGS="-Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=3 -std=c++14 $CXXFLAGS"
CPP_VERSION=c++14
AC_SUBST([CPP_VERSION])
CXXFLAGS="-Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=3 -std=$CPP_VERSION $CXXFLAGS"
dnl ----------------------------------------------
dnl For macOS

View File

@ -103,7 +103,7 @@ TESTS = \
test_string_util
clang-tidy:
clang-tidy -extra-arg-before=-xc++ -extra-arg=-std=c++14 \
clang-tidy -extra-arg-before=-xc++ -extra-arg=-std=@CPP_VERSION@ \
*.h $(s3fs_SOURCES) test_curl_util.cpp test_page_list.cpp test_string_util.cpp \
-- $(DEPS_CFLAGS) $(CPPFLAGS)

View File

@ -43,7 +43,7 @@ truncate_read_file_SOURCES = truncate_read_file.cc
cr_filename_SOURCES = cr_filename.cc
clang-tidy:
clang-tidy -extra-arg=-std=c++14 \
clang-tidy -extra-arg=-std=@CPP_VERSION@ \
$(junk_data_SOURCES) \
$(write_multiblock_SOURCES) \
$(mknod_test_SOURCES) \