File tree 9 files changed +22
-44
lines changed 9 files changed +22
-44
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,6 @@ jobs:
101
101
cc : clang
102
102
cxx : clang++
103
103
cxxflags : -Wno-deprecated-declarations
104
- - name : " C++14 mode"
105
- shortname : c++14
106
- tag : rolling
107
- cc : gcc
108
- cxx : g++
109
- cxxflags : " -std=c++14"
110
104
- name : " C++17 mode"
111
105
shortname : c++17
112
106
tag : rolling
Original file line number Diff line number Diff line change 96
96
cc : clang
97
97
cxx : clang++
98
98
cxxflags : -Wno-deprecated-declarations
99
- - name : " C++14 mode"
100
- shortname : c++14
101
- tag : rolling
102
- cc : gcc
103
- cxx : g++
104
- cxxflags : " -std=c++14"
105
99
- name : " C++17 mode"
106
100
shortname : c++17
107
101
tag : rolling
@@ -125,7 +119,6 @@ jobs:
125
119
tag : rolling
126
120
cc : gcc
127
121
cxx : g++
128
- cxxflags : " -std=c++17"
129
122
configureflags : --disable-std-function --disable-std-tuple --enable-std-pointers --enable-std-any --enable-std-optional
130
123
- name : " OpenMP enabled"
131
124
shortname : openmp
Original file line number Diff line number Diff line change 40
40
cxx : clang++
41
41
cxxflags : -Wno-deprecated-declarations
42
42
tests : true
43
- - name : " C++14 mode"
44
- shortname : c++14
45
- tag : rolling
46
- cc : gcc
47
- cxx : g++
48
- cxxflags : " -std=c++14"
49
43
- name : " C++17 mode"
50
44
shortname : c++17
51
45
tag : rolling
Original file line number Diff line number Diff line change 13
13
classes : [boost, std]
14
14
include :
15
15
- classes : std
16
- cxxflags : " -std=c++17"
17
16
configureflags : --disable-std-function --disable-std-tuple --enable-std-pointers --enable-std-optional --enable-std-any
18
17
steps :
19
18
- uses : actions/checkout@v4
28
27
- name : Build
29
28
run : |
30
29
./autogen.sh
31
- ./configure --disable-shared --with-boost-include=`brew --prefix`/include --enable-error-lines --enable-error-functions --enable-tracing --enable-indexed-coupons --enable-extra-safety-checks --enable-sessions --enable-thread-safe-observer-pattern --enable-intraday --disable-faster-lazy-objects --enable-throwing-in-cycles --enable-null-as-functions ${{ matrix.configureflags }} CC="clang" CXX="clang++" CXXFLAGS="-O2 -g0 -Wall -Werror ${{ matrix.cxxflags }} "
30
+ ./configure --disable-shared --with-boost-include=`brew --prefix`/include --enable-error-lines --enable-error-functions --enable-tracing --enable-indexed-coupons --enable-extra-safety-checks --enable-sessions --enable-thread-safe-observer-pattern --enable-intraday --disable-faster-lazy-objects --enable-throwing-in-cycles --enable-null-as-functions ${{ matrix.configureflags }} CC="clang" CXX="clang++" CXXFLAGS="-O2 -g0 -Wall -Werror"
32
31
make -j 3
33
32
- name : Run tests
34
33
run : |
Original file line number Diff line number Diff line change @@ -72,16 +72,16 @@ set(QL_EXTERNAL_SUBDIRECTORIES "" CACHE STRING "Optional list of external source
72
72
# set -lpapi here
73
73
set (QL_EXTRA_LINK_LIBRARIES "" CACHE STRING "Optional extra link libraries to add to QuantLib" )
74
74
75
- # Require C++14 or higher
75
+ # Require C++17 or higher
76
76
if (NOT DEFINED CMAKE_CXX_STANDARD)
77
- set (CMAKE_CXX_STANDARD 14 )
78
- elseif (CMAKE_CXX_STANDARD LESS 14 )
79
- message (FATAL_ERROR "Please specify CMAKE_CXX_STANDARD of 14 or higher" )
77
+ set (CMAKE_CXX_STANDARD 17 )
78
+ elseif (CMAKE_CXX_STANDARD LESS 17 )
79
+ message (FATAL_ERROR "Please specify CMAKE_CXX_STANDARD of 17 or higher" )
80
80
endif ()
81
81
if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED)
82
82
set (CMAKE_CXX_STANDARD_REQUIRED ON )
83
83
endif ()
84
- # Avoid use of compiler language extensions, i.e. -std=c++14 not -std=gnu++14
84
+ # Avoid use of compiler language extensions, i.e. -std=c++17 not -std=gnu++17
85
85
if (NOT DEFINED CMAKE_CXX_EXTENSIONS)
86
86
set (CMAKE_CXX_EXTENSIONS FALSE )
87
87
endif ()
Original file line number Diff line number Diff line change 1
1
2
- # QL_CHECK_CPP14
2
+ # QL_CHECK_CPP17
3
3
# --------------------
4
- # Check whether C++14 features are supported by default.
5
- # If not (e.g., with Clang on Mac OS) add -std=c++14
6
- AC_DEFUN ( [ QL_CHECK_CPP14 ] ,
7
- [ AC_MSG_CHECKING ( [ for C++14 support] )
4
+ # Check whether C++17 features are supported by default.
5
+ # If not (e.g., with Clang on Mac OS) add -std=c++17
6
+ AC_DEFUN ( [ QL_CHECK_CPP17 ] ,
7
+ [ AC_MSG_CHECKING ( [ for C++17 support] )
8
8
AC_COMPILE_IFELSE (
9
9
[ AC_LANG_PROGRAM (
10
- [ [ @%:@ include <memory>
11
- class C {
12
- public:
13
- C(int) noexcept;
14
- auto f() { return std::make_unique<C>(1); }
15
- };
10
+ [ [ @%:@ include <optional>
11
+ int main() {
12
+ auto x = std::optional<int>{42};
13
+ }
16
14
] ] ,
17
15
[ [ ] ] ) ] ,
18
16
[ AC_MSG_RESULT ( [ yes] ) ] ,
19
- [ AC_MSG_RESULT ( [ no: adding -std=c++14 to CXXFLAGS] )
20
- AC_SUBST ( [ CPP14_CXXFLAGS ] ,[ "-std=c++14 "] )
21
- AC_SUBST ( [ CXXFLAGS] ,[ "${CXXFLAGS} -std=c++14 "] )
17
+ [ AC_MSG_RESULT ( [ no: adding -std=c++17 to CXXFLAGS] )
18
+ AC_SUBST ( [ CPP17_CXXFLAGS ] ,[ "-std=c++17 "] )
19
+ AC_SUBST ( [ CXXFLAGS] ,[ "${CXXFLAGS} -std=c++17 "] )
22
20
] )
23
21
] )
24
22
Original file line number Diff line number Diff line change @@ -64,8 +64,8 @@ if test "$ql_openmp" = "yes" ; then
64
64
AC_SUBST ( [ CXXFLAGS] ,[ "${CXXFLAGS} ${OPENMP_CXXFLAGS}"] )
65
65
fi
66
66
67
- # Check for C++14 support
68
- QL_CHECK_CPP14
67
+ # Check for C++17 support
68
+ QL_CHECK_CPP17
69
69
70
70
# Check for other compiler flags
71
71
QL_CHECK_SYSTEM_HEADER_PREFIX
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ while test $# -gt 0; do
39
39
echo @PACKAGE_VERSION@
40
40
;;
41
41
--cflags)
42
- echo -I@includedir@ @BOOST_INCLUDE@ @OPENMP_CXXFLAGS@ @PTHREAD_CXXFLAGS@ @CPP14_CXXFLAGS @
42
+ echo -I@includedir@ @BOOST_INCLUDE@ @OPENMP_CXXFLAGS@ @PTHREAD_CXXFLAGS@ @CPP17_CXXFLAGS @
43
43
;;
44
44
--libs)
45
45
echo -L@libdir@ -lQuantLib @OPENMP_CXXFLAGS@ @PTHREAD_LIB@
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ includedir=@includedir@
6
6
Name: QuantLib
7
7
Description: The free/open-source library for quantitative finance.
8
8
Version: @PACKAGE_VERSION@
9
- Cflags: -I@includedir@ @BOOST_INCLUDE@ @OPENMP_CXXFLAGS@ @PTHREAD_CXXFLAGS@ @CPP14_CXXFLAGS @
9
+ Cflags: -I@includedir@ @BOOST_INCLUDE@ @OPENMP_CXXFLAGS@ @PTHREAD_CXXFLAGS@ @CPP17_CXXFLAGS @
10
10
Libs: -L@libdir@ -lQuantLib @OPENMP_CXXFLAGS@ @PTHREAD_LIB@
You can’t perform that action at this time.
0 commit comments