Update to C++14

This updates the qmake and cmake files to enable C++14 support in the
compiler. It also simplifies a function by using a new function
introduced in C++14.
This commit is contained in:
Martin Kleusberg
2021-01-11 18:40:11 +01:00
parent 6f4990544b
commit 740c88b702
4 changed files with 5 additions and 12 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ please consult http://www.qt.io and for SQLite please see https://sqlite.org/.
Please note that all versions after 3.9.1 will require:
* Qt 5.5 or later, however we advise you to use 5.7 or later
* A C++ compiler with support for C++11 or later
* A C++ compiler with support for C++14 or later
Without these or with older versions you won't be able to compile DB Browser for
Sqlite anymore. This applies to all platforms. However, most likely you won't
+2 -2
View File
@@ -24,8 +24,8 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
add_definitions(-std=c++11)
set(CMAKE_CXX_STANDARD 11)
add_definitions(-std=c++14)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Fix behavior of CMAKE_CXX_STANDARD when targeting macOS.
+1 -8
View File
@@ -27,16 +27,9 @@ bool compare_ci(const T& a, const T& b)
{
// Note: This function does not have to be (actually it must not be) fully UTF-8 aware because SQLite itself is not either.
if(a.length() != b.length())
return false;
return std::equal(a.begin(), a.end(), b.begin(), [](unsigned char c1, unsigned char c2) {
return std::equal(a.begin(), a.end(), b.begin(), b.end(), [](unsigned char c1, unsigned char c2) {
return std::tolower(c1) == std::tolower(c2);
});
// TODO Replace the entire code above by the following once we have enabled C++14 support
/*return std::equal(a.begin(), a.end(), b.begin(), b.end(), [](unsigned char c1, unsigned char c2) {
return std::tolower(c1) == std::tolower(c2);
});*/
}
template<typename T>
+1 -1
View File
@@ -8,7 +8,7 @@ CONFIG += debug_and_release
CONFIG += qt
CONFIG += warn_on
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CXXFLAGS += -std=c++14
# create a unittest option
CONFIG(unittest) {