Skip to content

Commit

Permalink
configure: Enforce C++17
Browse files Browse the repository at this point in the history
Construction of a 3.1.0 release involves taking features on the development branch and separating them from the adoption of cmake in #2689. Some of these changes involve the use of C++17 features. However the transition to defaulting to C++17 was performed exclusively within the cmake ecosystem. This commit modifies the legacy "configure" script to reflect the increment to use of C++17.
  • Loading branch information
Lestropie committed Feb 21, 2024
1 parent 4a51096 commit c6ab324
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ENVIRONMENT VARIABLES
CXXSTD
Set the version of the C++ standard to use. The minimum (and default)
is c++11. To use Qt6, you will need to set this to c++17.
is c++17.
'''

system = platform.system().lower()
Expand Down Expand Up @@ -302,7 +302,7 @@ else:
log ('PATH set to: ' + path)


cpp_std = 'c++11'
cpp_std = 'c++17'
if 'CXXSTD' in os.environ:
std = os.environ['CXXSTD']
if std:
Expand All @@ -313,7 +313,7 @@ if 'CXXSTD' in os.environ:
try:
from shlex import quote # pylint: disable=unused-variable, unused-import
from shutil import which # pylint: disable=unused-variable, unused-import
report ('Python verion: ' + platform.python_version())
report ('Python verion: ' + platform.python_version() + '\n')
except ImportError:
error ('Incompatible Python version detected: ' + platform.python_version() + '(at least 3.3 is required)')

Expand Down Expand Up @@ -803,7 +803,7 @@ for candidate in cxx:
report ('not found\n')
continue

if compile_test ('C++11 compliance', cpp_flags, ld_flags, '''
if compile_test ('C++17 compliance', cpp_flags, ld_flags, '''
#include <cstddef>
struct Base {
Base (int);
Expand All @@ -813,7 +813,8 @@ struct Derived : Base {
};
int main() {
Derived D (int); // check for contructor inheritance
Derived D (int); // check for C++11 contructor inheritance
auto f = [](auto i) { }; // check for C++17 auto in lambda parameter
return 0;
}
''', on_failure='test failed (see configure.log for details)\n'):
Expand Down

0 comments on commit c6ab324

Please sign in to comment.