From f441ec5c3570ad92fa8fa50dda45381c7b1926cc Mon Sep 17 00:00:00 2001 From: Alexey Nagaev Date: Thu, 3 Apr 2025 03:02:37 +0300 Subject: [PATCH] Testing clang build --- Common/3dParty/boost/boost.pri | 5 +++ Common/base.pri | 33 ++++++++++++++++++- DesktopEditor/graphics/pro/raster.pri | 4 +++ .../raster/Metafile/Common/MetaFileTypes.h | 1 + DesktopEditor/xml/build/qt/libxml2.pri | 4 +++ OfficeUtils/OfficeUtils.pri | 3 ++ 6 files changed, 49 insertions(+), 1 deletion(-) diff --git a/Common/3dParty/boost/boost.pri b/Common/3dParty/boost/boost.pri index 7a0278cea4..1e6a683ad5 100644 --- a/Common/3dParty/boost/boost.pri +++ b/Common/3dParty/boost/boost.pri @@ -4,6 +4,11 @@ CORE_BOOST_LIBS = $$PWD/build/$$CORE_BUILDS_PLATFORM_PREFIX/lib core_ios:CONFIG += disable_enum_constexpr_conversion core_android:CONFIG += disable_enum_constexpr_conversion core_mac:CONFIG += disable_enum_constexpr_conversion +core_linux_clang:CONFIG += disable_enum_constexpr_conversion + +core_linux_clang { + DEFINES += _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION +} core_android { INCLUDEPATH += $$PWD/build/android/include diff --git a/Common/base.pri b/Common/base.pri index e8dc81b132..1a0473e98a 100644 --- a/Common/base.pri +++ b/Common/base.pri @@ -109,6 +109,35 @@ win32:!contains(QMAKE_TARGET.arch, x86_64): { CONFIG += core_win_32 } +linux-clang-libc++ { + CONFIG += core_linux + CONFIG += core_linux_64 + CONFIG += core_linux_clang + message("linux-64-clang-libc++") +} +linux-clang-libc++-32 { + CONFIG += core_linux + CONFIG += core_linux_32 + CONFIG += core_linux_clang + message("linux-32-clang-libc++") +} +linux-clang { + CONFIG += core_linux + CONFIG += core_linux_64 + CONFIG += core_linux_clang + message("linux-64-clang") +} +linux-clang-32 { + CONFIG += core_linux + CONFIG += core_linux_32 + CONFIG += core_linux_clang + message("linux-32-clang") +} + +core_linux_clang { + CONFIG += c++1z +} + linux-g++ { CONFIG += core_linux linux-g++:contains(QMAKE_HOST.arch, x86_64): { @@ -246,9 +275,11 @@ core_linux { } core_linux { +!core_linux_clang { equals(TEMPLATE, app):CONFIG += core_static_link_libstd plugin:CONFIG += core_static_link_libstd } +} core_win_32 { CORE_BUILDS_PLATFORM_PREFIX = win_32 @@ -414,7 +445,7 @@ core_windows:CONFIG += no_batch message($$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX) # COMPILER -CONFIG += c++11 +# CONFIG += c++11 !core_windows { QMAKE_CXXFLAGS += -Wno-register diff --git a/DesktopEditor/graphics/pro/raster.pri b/DesktopEditor/graphics/pro/raster.pri index f5e54810fc..28d4b2d2d8 100644 --- a/DesktopEditor/graphics/pro/raster.pri +++ b/DesktopEditor/graphics/pro/raster.pri @@ -19,6 +19,10 @@ core_linux { QMAKE_CXXFLAGS += -Wno-narrowing } +core_linux_clang { + QMAKE_CFLAGS += -Wno-incompatible-function-pointer-types +} + core_mac { DEFINES += HAVE_UNISTD_H HAVE_FCNTL_H } diff --git a/DesktopEditor/raster/Metafile/Common/MetaFileTypes.h b/DesktopEditor/raster/Metafile/Common/MetaFileTypes.h index 09ff44864a..e3ec2d110b 100644 --- a/DesktopEditor/raster/Metafile/Common/MetaFileTypes.h +++ b/DesktopEditor/raster/Metafile/Common/MetaFileTypes.h @@ -34,6 +34,7 @@ #include #include +#include #include "../../../common/StringExt.h" #ifndef BYTE diff --git a/DesktopEditor/xml/build/qt/libxml2.pri b/DesktopEditor/xml/build/qt/libxml2.pri index 960bacfa1a..1cfa7555a9 100644 --- a/DesktopEditor/xml/build/qt/libxml2.pri +++ b/DesktopEditor/xml/build/qt/libxml2.pri @@ -1,3 +1,7 @@ +core_linux_clang { + QMAKE_CFLAGS += -std=c99 +} + DEFINES += HAVE_VA_COPY core_static_link_xml_full { diff --git a/OfficeUtils/OfficeUtils.pri b/OfficeUtils/OfficeUtils.pri index b4e1f497a8..232efd8f4e 100644 --- a/OfficeUtils/OfficeUtils.pri +++ b/OfficeUtils/OfficeUtils.pri @@ -5,6 +5,9 @@ core_mac { QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers DEFINES += unix } +core_linux_clang { + QMAKE_CFLAGS += -Wno-implicit-function-declaration +} build_zlib_as_sources { DEFINES += BUILD_ZLIB_AS_SOURCES