Skip to content

Commit ea99231

Browse files
committed
[INFRA] Bump to C++23
1 parent 0cab5ec commit ea99231

File tree

8 files changed

+39
-48
lines changed

8 files changed

+39
-48
lines changed

.github/workflows/ci_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
compiler: ["clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12", "gcc-11", "intel"]
35+
compiler: ["clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12", "intel"]
3636
container:
3737
image: ghcr.io/seqan/${{ matrix.compiler }}
3838
volumes:

.github/workflows/ci_macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
compiler: ["clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12", "gcc-11"]
35+
compiler: ["clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12"]
3636
steps:
3737
- name: Checkout
3838
uses: actions/checkout@v4

.github/workflows/ci_misc.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
use_include_dependencies: "OFF"
4141
cxx_flags: "-stdlib=libc++"
4242

43-
- name: "Snippet gcc11"
44-
compiler: "gcc-11"
43+
- name: "Snippet gcc12"
44+
compiler: "gcc-12"
4545
build: snippet
4646
build_type: Release
4747
use_include_dependencies: "OFF"
@@ -53,8 +53,8 @@ jobs:
5353
use_include_dependencies: "OFF"
5454
cxx_flags: "-stdlib=libc++"
5555

56-
- name: "Performance gcc11"
57-
compiler: "gcc-11"
56+
- name: "Performance gcc12"
57+
compiler: "gcc-12"
5858
build: performance
5959
build_type: Release
6060
use_include_dependencies: "OFF"
@@ -72,8 +72,8 @@ jobs:
7272
build_type: Release
7373
use_include_dependencies: "OFF"
7474

75-
- name: "Header gcc11"
76-
compiler: "gcc-11"
75+
- name: "Header gcc12"
76+
compiler: "gcc-12"
7777
build: header
7878
build_type: Release
7979
use_include_dependencies: "OFF"
@@ -85,7 +85,7 @@ jobs:
8585
use_include_dependencies: "ON"
8686

8787
- name: "Tutorial"
88-
compiler: "gcc-11"
88+
compiler: "gcc-12"
8989
build: tutorial
9090
build_type: Debug
9191
use_include_dependencies: "OFF"

cmake/CPM.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#
33
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
44

5-
set (CPM_DOWNLOAD_VERSION 0.38.6)
6-
set (CPM_HASH_SUM "11c3fa5f1ba14f15d31c2fb63dbc8628ee133d81c8d764caad9a8db9e0bacb07")
5+
set (CPM_DOWNLOAD_VERSION 0.40.2)
6+
set (CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")
77

88
if (CPM_SOURCE_CACHE)
99
set (CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")

cmake/configuration.cmake

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,43 +79,42 @@ include ("${HIBF_SOURCE_DIR}/test/cmake/hibf_require_ccache.cmake")
7979
hibf_require_ccache ()
8080

8181
# ----------------------------------------------------------------------------
82-
# Require C++20
82+
# Require C++23
8383
# ----------------------------------------------------------------------------
8484

8585
set (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
8686

8787
set (CXXSTD_TEST_SOURCE
88-
"#if !defined (__cplusplus) || (__cplusplus < 202002)
89-
#error NOCXX20
88+
"#if !defined (__cplusplus) || (__cplusplus < 202100)
89+
#error NOCXX23
9090
#endif
9191
int main() {}")
9292

93-
set (HIBF_FEATURE_CPP20_FLAG_BUILTIN "")
94-
set (HIBF_FEATURE_CPP20_FLAG_STD20 "-std=c++20")
95-
set (HIBF_FEATURE_CPP20_FLAG_STD2a "-std=c++2a")
93+
set (HIBF_FEATURE_CPP23_FLAG_BUILTIN "")
94+
set (HIBF_FEATURE_CPP23_FLAG_STD23 "-std=c++23")
9695

97-
set (HIBF_CPP20_FLAG "")
96+
set (HIBF_CPP23_FLAG "")
9897

99-
foreach (_FLAG BUILTIN STD20 STD2a)
100-
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_SAVE} ${HIBF_FEATURE_CPP20_FLAG_${_FLAG}}")
98+
foreach (_FLAG BUILTIN STD23)
99+
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_SAVE} ${HIBF_FEATURE_CPP23_FLAG_${_FLAG}}")
101100

102-
check_cxx_source_compiles ("${CXXSTD_TEST_SOURCE}" CPP20_FLAG_${_FLAG})
101+
check_cxx_source_compiles ("${CXXSTD_TEST_SOURCE}" CPP23_FLAG_${_FLAG})
103102

104-
if (CPP20_FLAG_${_FLAG})
105-
set (HIBF_CPP20_FLAG ${_FLAG})
103+
if (CPP23_FLAG_${_FLAG})
104+
set (HIBF_CPP23_FLAG ${_FLAG})
106105
break ()
107106
endif ()
108107
endforeach ()
109108

110109
set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
111110

112-
if (HIBF_CPP20_FLAG STREQUAL "BUILTIN")
113-
hibf_config_print ("C++ Standard-20 support: builtin")
114-
elseif (HIBF_CPP20_FLAG)
115-
set (HIBF_CXX_FLAGS "${HIBF_CXX_FLAGS} ${HIBF_FEATURE_CPP20_FLAG_${HIBF_CPP20_FLAG}}")
116-
hibf_config_print ("C++ Standard-20 support: via ${HIBF_FEATURE_CPP20_FLAG_${HIBF_CPP20_FLAG}}")
111+
if (HIBF_CPP23_FLAG STREQUAL "BUILTIN")
112+
hibf_config_print ("C++ Standard-23 support: builtin")
113+
elseif (HIBF_CPP23_FLAG)
114+
set (HIBF_CXX_FLAGS "${HIBF_CXX_FLAGS} ${HIBF_FEATURE_CPP23_FLAG_${HIBF_CPP23_FLAG}}")
115+
hibf_config_print ("C++ Standard-23 support: via ${HIBF_FEATURE_CPP23_FLAG_${HIBF_CPP23_FLAG}}")
117116
else ()
118-
hibf_config_error ("HIBF requires C++20, but your compiler does not support it.")
117+
hibf_config_error ("HIBF requires C++23, but your compiler does not support it.")
119118
endif ()
120119

121120
# ----------------------------------------------------------------------------

cmake/package-lock.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CPMDeclarePackage (benchmark
3131
# googletest
3232
set (HIBF_GOOGLETEST_VERSION 1.14.0)
3333
CPMDeclarePackage (googletest
34-
NAME GTest
34+
NAME googletest
3535
VERSION ${HIBF_GOOGLETEST_VERSION}
3636
GITHUB_REPOSITORY google/googletest
3737
SYSTEM TRUE

include/hibf/platform.hpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,9 @@
6666
// ============================================================================
6767

6868
#if HIBF_COMPILER_IS_GCC
69-
# if (__GNUC__ < 11)
70-
# error "At least GCC 11 is needed."
71-
# endif // (__GNUC__ < 11)
72-
73-
# if (__GNUC__ == 11 && __GNUC_MINOR__ <= 3)
74-
# pragma warning "Be aware that GCC < 11.4 might have bugs that cause compile failure."
75-
# endif // (__GNUC__ == 11 && __GNUC_MINOR__ <= 3)
69+
# if (__GNUC__ < 12)
70+
# error "At least GCC 12 is needed."
71+
# endif // (__GNUC__ < 12)
7672

7773
# if (__GNUC__ == 12 && __GNUC_MINOR__ <= 2)
7874
# pragma warning "Be aware that GCC < 12.3 might have bugs that cause compile failure."
@@ -100,10 +96,9 @@
10096
#endif
10197

10298
// C++ standard [required]
103-
// Note: gcc10 -std=c++20 still defines __cplusplus=201709
10499
#ifdef __cplusplus
105-
# if (__cplusplus < 201709)
106-
# error "C++20 is required, make sure that you have set -std=c++20."
100+
# if (__cplusplus < 202100)
101+
# error "C++23 is required, make sure that you have set -std=c++23."
107102
# endif
108103
#else
109104
# error "This is not a C++ compiler."

util/CMakeLists.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@ add_subdirectory ("${HIBF_ROOT_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/hibf_lib")
1616

1717
# Dependency: Sharg
1818
include (FetchContent)
19+
option (SHARG_NO_TDL "" ON)
1920
FetchContent_Declare (
2021
sharg
21-
URL "https://github.com/seqan/sharg-parser/releases/download/1.1.1/sharg-1.1.1-Source.tar.xz"
22-
URL_HASH SHA256=7330f06501718e7871e55e5fd70d0e41472cc8b34bd0e3519f8c5547510c671c
23-
PATCH_COMMAND curl https://github.com/seqan/sharg-parser/commit/bbbfca65333b00317b3e99a35e64f44a5c3224d6.patch |
24-
patch --strip=1 --force)
25-
FetchContent_Populate (sharg)
26-
list (APPEND CMAKE_PREFIX_PATH "${sharg_SOURCE_DIR}/build_system")
27-
find_package (sharg 1.0 REQUIRED)
22+
GIT_REPOSITORY https://github.com/seqan/sharg-parser
23+
GIT_TAG 7534545c5f5dca3876ca3d3b07c369131b185f92)
24+
FetchContent_MakeAvailable (sharg)
2825

2926
add_executable (fpr_correction_check fpr_correction_check.cpp)
30-
target_link_libraries (fpr_correction_check seqan::hibf sharg::sharg)
27+
target_link_libraries (fpr_correction_check sharg::sharg seqan::hibf)

0 commit comments

Comments
 (0)