summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>2022-03-23 08:51:42 +0000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-04-07 17:01:39 +0000
commitb3f7e2ae95ec839058a2a8f82b9b568a2e875a5e (patch)
tree28d0cfef91e2223d804c3057b835ac5f2eb0c8c0
parentea825050244238b65895f44c13076bc3fa025c5d (diff)
Fix build with libc++
Fix build with libc++ on linux by adding missing use_libcxx parameter. Check if re2 and poppler can be used as they use std::string in their api. Add compiler test to check that. Change-Id: I74bf79b8443ad470621c1a2e0c9dc768d4cca1f1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 288f60442fefa717dfc3c7587f1d480910b50874) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--cmake/Functions.cmake3
-rw-r--r--configure.cmake5
-rw-r--r--src/core/api/configure.cmake19
-rw-r--r--tests/auto/widgets/printing/CMakeLists.txt4
-rw-r--r--tests/auto/widgets/printing/tst_printing.cpp7
5 files changed, 31 insertions, 7 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 08967d6db..77fef2114 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -880,6 +880,9 @@ macro(append_compiler_linker_sdk_setup)
ios_enable_code_signing=false
)
endif()
+ extend_gn_list(gnArgArg ARGS use_libcxx
+ CONDITION QT_FEATURE_stdlib_libcpp OR MACOS
+ )
else()
if(QT_FEATURE_use_lld_linker)
get_filename_component(clangBasePath ${CMAKE_LINKER} DIRECTORY)
diff --git a/configure.cmake b/configure.cmake
index 7d92341f8..106fe86d9 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -71,11 +71,14 @@ qt_config_compile_test(re2
CODE
"
#include \"re2/filtered_re2.h\"
+#include <vector>
int main() {
std::string s;
re2::FilteredRE2 fre2(1);
int id = 0;
fre2.Add(s, {}, &id);
+ std::vector<std::string> pattern = {\"match\"};
+ fre2.Compile(&pattern);
const RE2 &re2 = fre2.GetRE2(id);
}"
)
@@ -269,7 +272,7 @@ qt_feature("webengine-developer-build" PRIVATE
)
qt_feature("webengine-system-re2" PRIVATE
LABEL "re2"
- AUTODETECT UNIX AND TEST_re2
+ CONDITION UNIX AND TEST_re2
)
qt_feature("webengine-system-icu" PRIVATE
LABEL "icu"
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index a9dd9eb09..7970617ba 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -8,6 +8,7 @@ if(NOT QT_CONFIGURE_RUNNING)
pkg_check_modules(ALSA alsa IMPORTED_TARGET)
pkg_check_modules(PULSEAUDIO libpulse>=0.9.10 libpulse-mainloop-glib)
pkg_check_modules(XDAMAGE xdamage)
+ pkg_check_modules(POPPLER_CPP poppler-cpp IMPORTED_TARGET)
if(NOT GIO_FOUND)
pkg_check_modules(GIO gio-2.0)
endif()
@@ -19,6 +20,19 @@ endif()
#### Tests
+qt_config_compile_test(poppler
+ LABEL "poppler"
+ LIBRARIES
+ PkgConfig::POPPLER_CPP
+ CODE
+"
+#include <poppler-document.h>
+
+int main() {
+ auto *pdf = poppler::document::load_from_raw_data(\"file\",100,std::string(\"user\"));
+}"
+)
+
qt_config_compile_test(alsa
LABEL "alsa"
LIBRARIES
@@ -131,6 +145,11 @@ qt_feature("webengine-sanitizer" PRIVATE
AUTODETECT CLANG
CONDITION CLANG AND ECM_ENABLE_SANITIZERS
)
+# internal testing feature
+qt_feature("webengine-system-poppler" PRIVATE
+ LABEL "popler"
+ CONDITION UNIX AND TEST_poppler
+)
qt_configure_add_summary_section(NAME "Qt WebEngineCore")
qt_configure_add_summary_entry(ARGS "webengine-embedded-build")
qt_configure_add_summary_entry(ARGS "webengine-full-debug-info")
diff --git a/tests/auto/widgets/printing/CMakeLists.txt b/tests/auto/widgets/printing/CMakeLists.txt
index e61b8cc89..9e14fd752 100644
--- a/tests/auto/widgets/printing/CMakeLists.txt
+++ b/tests/auto/widgets/printing/CMakeLists.txt
@@ -17,9 +17,7 @@ qt_internal_add_test(tst_printing
)
qt_internal_extend_target(tst_printing
- CONDITION POPPLER_CPP_FOUND
- DEFINES
- POPPLER_CPP
+ CONDITION POPPLER_CPP_FOUND AND QT_FEATURE_webengine_system_poppler
LIBRARIES
PkgConfig::POPPLER_CPP
)
diff --git a/tests/auto/widgets/printing/tst_printing.cpp b/tests/auto/widgets/printing/tst_printing.cpp
index 0559fb787..81d5d9442 100644
--- a/tests/auto/widgets/printing/tst_printing.cpp
+++ b/tests/auto/widgets/printing/tst_printing.cpp
@@ -27,13 +27,14 @@
****************************************************************************/
#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
+#include <QtWebEngineCore/qtwebenginecore-config.h>
#include <QWebEngineView>
#include <QTemporaryDir>
#include <QTest>
#include <QSignalSpy>
#include <util.h>
-#if defined(POPPLER_CPP)
+#if QT_CONFIG(webengine_system_poppler)
#include <poppler-document.h>
#include <poppler-page.h>
#endif
@@ -44,7 +45,7 @@ class tst_Printing : public QObject
private slots:
void printToPdfBasic();
void printRequest();
-#if defined(POPPLER_CPP) && defined(Q_OS_LINUX) && defined(__GLIBCXX__)
+#if QT_CONFIG(webengine_system_poppler)
void printToPdfPoppler();
#endif
};
@@ -110,7 +111,7 @@ void tst_Printing::printRequest()
QVERIFY(data.length() > 0);
}
-#if defined(POPPLER_CPP) && defined(Q_OS_LINUX) && defined(__GLIBCXX__)
+#if QT_CONFIG(webengine_system_poppler)
void tst_Printing::printToPdfPoppler()
{
// check if generated pdf is correct by searching for a know string on the page