diff --git a/CMakeLists.txt b/CMakeLists.txt index 55eed972..84e29d10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,18 @@ set(SCAP_WORKBENCH_VERSION_PATCH "1") set(SCAP_WORKBENCH_VERSION "${SCAP_WORKBENCH_VERSION_MAJOR}.${SCAP_WORKBENCH_VERSION_MINOR}.${SCAP_WORKBENCH_VERSION_PATCH}") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_VERBOSE_MAKEFILE ON) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS ON) + +if(CMAKE_CXX_COMPILER_ID STREQUAL Clang) + set(CLANG_DEFAULT_CXX_STDLIB libc++) + set(CLANG_DEFAULT_RTLIB compiler-rt) +endif() + include(GNUInstallDirs) set(CMAKE_AUTOMOC ON) @@ -148,7 +160,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VE endif() if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-c++20-compat") endif() include_directories(${SCAP_WORKBENCH_INCLUDE_DIRS}) diff --git a/src/OscapCapabilities.cpp b/src/OscapCapabilities.cpp index 83d75f7c..72ff7aaa 100644 --- a/src/OscapCapabilities.cpp +++ b/src/OscapCapabilities.cpp @@ -86,7 +86,7 @@ void OscapCapabilities::parse(const QString& mmv) if (lines.size() < 1) return; // TODO: Throw exception? -#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) const QStringList firstLine = lines[0].split(' ', Qt::SkipEmptyParts); #else const QStringList firstLine = lines[0].split(' ', QString::SkipEmptyParts); diff --git a/src/RPMOpenHelper.cpp b/src/RPMOpenHelper.cpp index 180571b1..ce41111d 100644 --- a/src/RPMOpenHelper.cpp +++ b/src/RPMOpenHelper.cpp @@ -54,7 +54,7 @@ RPMOpenHelper::RPMOpenHelper(const QString& path) static QRegExp tailoringRE("^\\.\\/usr\\/share\\/xml\\/scap\\/[^\\/]+\\/tailoring-xccdf\\.xml+$"); static QRegExp inputRE("^\\.\\/usr\\/share\\/xml\\/scap\\/[^\\/]+\\/[^\\/]+\\-(xccdf|ds)\\.xml+$"); -#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) QStringList lines = proc.getStdErrContents().split('\n', Qt::SkipEmptyParts); #else QStringList lines = proc.getStdErrContents().split('\n', QString::SkipEmptyParts);