From b3f7e2ae95ec839058a2a8f82b9b568a2e875a5e Mon Sep 17 00:00:00 2001 From: Qt Submodule Update Bot Date: Wed, 23 Mar 2022 08:51:42 +0000 Subject: 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 (cherry picked from commit 288f60442fefa717dfc3c7587f1d480910b50874) Reviewed-by: Qt Cherry-pick Bot --- cmake/Functions.cmake | 3 +++ configure.cmake | 5 ++++- src/core/api/configure.cmake | 19 +++++++++++++++++++ tests/auto/widgets/printing/CMakeLists.txt | 4 +--- tests/auto/widgets/printing/tst_printing.cpp | 7 ++++--- 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 int main() { std::string s; re2::FilteredRE2 fre2(1); int id = 0; fre2.Add(s, {}, &id); + std::vector 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 + +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 +#include #include #include #include #include #include -#if defined(POPPLER_CPP) +#if QT_CONFIG(webengine_system_poppler) #include #include #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 -- cgit v1.2.3