From 5f6d0ef7b1bd9af578fde5f04db46372b260cc94 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Wed, 12 Jul 2023 20:57:29 -0700 Subject: [PATCH 1/2] fix qt_version_check: 5.15 => 5.14 Signed-off-by: Stephen L Arnold --- src/OscapCapabilities.cpp | 2 +- src/RPMOpenHelper.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); From 2ef77f64344ae1f0f880f8ebbea159ecb671d9ad Mon Sep 17 00:00:00 2001 From: Steve Arnold Date: Sat, 10 Feb 2024 15:07:59 -0800 Subject: [PATCH 2/2] set the base C++ std version to c++11 and do not force c++20 err * setting -Werror with recent GNU forces c++20 build errors * need to set -Wno-c++20-compat or else disable -Werror Signed-off-by: Steve Arnold --- CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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})