summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-02-02 10:49:19 +0100
committerMichal Klocek <michal.klocek@qt.io>2021-05-12 09:40:28 +0200
commita60304e7ea154438060a71959f72a4a1b95f5327 (patch)
tree8aca57af64fcfa579c63cd2a0caa5c6073544cd4 /src
parentb8fb47478db06cac231a8a7222e7afbce7b3cf90 (diff)
Add configure.cmake files
Only evaluate features in the super repo and do not create config headers files during the configure step. However, print the build summary. The build config headers will be created during the configure step of 'libs' external project. Done-With: Jüri Valdmann <juri.valdmann@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Task-number: QTBUG-91760 Task-number: COIN-711 Change-Id: I481525571e71ca4684de5827f641416035a8f22a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/api/configure.cmake155
1 files changed, 155 insertions, 0 deletions
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
new file mode 100644
index 000000000..8986bf54e
--- /dev/null
+++ b/src/core/api/configure.cmake
@@ -0,0 +1,155 @@
+#### Libraries
+
+find_package(PkgConfig)
+if(PkgConfig_FOUND)
+ pkg_check_modules(ALSA alsa IMPORTED_TARGET)
+ pkg_check_modules(PULSEAUDIO libpulse>=0.9.10 libpulse-mainloop-glib)
+ pkg_check_modules(GIO gio-2.0)
+endif()
+
+find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS Positioning WebChannel PrintSupport)
+
+#### Tests
+
+qt_config_compile_test(alsa
+ LABEL "alsa"
+ LIBRARIES
+ PkgConfig::ALSA
+ CODE
+"
+#include \"alsa/asoundlib.h\"
+#if SND_LIB_VERSION < 0x1000a // 1.0.10
+#error Alsa version found too old, require >= 1.0.10
+#endif
+int main(){};
+")
+
+#### Features
+
+qt_feature("webengine-embedded-build" PRIVATE
+ LABEL "Embedded build"
+ PURPOSE "Enables the embedded build configuration."
+ AUTODETECT tests.webengine-embedded-build OR FIXME
+ CONDITION UNIX
+)
+qt_feature("webengine-system-alsa" PRIVATE
+ LABEL "Use ALSA"
+ CONDITION UNIX AND TEST_alsa
+)
+qt_feature("webengine-v8-snapshot-support" PRIVATE
+ LABEL "Building v8 snapshot supported"
+ CONDITION NOT UNIX OR NOT QT_FEATURE_cross_compile OR ( TEST_architecture_arch STREQUAL arm64 ) OR TEST_webengine_host_compiler
+)
+qt_feature("webengine-geolocation" PUBLIC
+ LABEL "Geolocation"
+ CONDITION TARGET Qt::Positioning
+)
+qt_feature("webengine-system-pulseaudio" PRIVATE
+ LABEL "Use PulseAudio"
+ AUTODETECT UNIX
+ CONDITION PULSEAUDIO_FOUND
+)
+qt_feature("webengine-pepper-plugins" PRIVATE
+ LABEL "Pepper Plugins"
+ PURPOSE "Enables use of Pepper Flash plugins."
+ AUTODETECT NOT QT_FEATURE_webengine_embedded_build
+)
+qt_feature("webengine-printing-and-pdf" PRIVATE
+ LABEL "Printing and PDF"
+ PURPOSE "Provides printing and output to PDF."
+ AUTODETECT NOT QT_FEATURE_webengine_embedded_build
+ CONDITION TARGET Qt::PrintSupport AND QT_FEATURE_printer
+)
+qt_feature("webengine-webchannel" PUBLIC
+ SECTION "WebEngine"
+ LABEL "WebChannel support"
+ PURPOSE "Provides QtWebChannel integration."
+ CONDITION TARGET Qt::WebChannel
+)
+qt_feature("webengine-proprietary-codecs" PRIVATE
+ LABEL "Proprietary Codecs"
+ PURPOSE "Enables the use of proprietary codecs such as h.264/h.265 and MP3."
+ AUTODETECT OFF
+)
+qt_feature("webengine-kerberos" PRIVATE
+ SECTION "WebEngine"
+ LABEL "Kerberos Authentication"
+ PURPOSE "Enables Kerberos Authentication Support"
+ AUTODETECT WIN32
+)
+qt_feature("webengine-spellchecker" PUBLIC
+ LABEL "Spellchecker"
+ PURPOSE "Provides a spellchecker."
+ AUTODETECT OFF
+)
+qt_feature("webengine-native-spellchecker" PUBLIC
+ LABEL "Native Spellchecker"
+ PURPOSE "Use the system's native spellchecking engine."
+ AUTODETECT OFF
+ CONDITION MACOS AND QT_FEATURE_webengine_spellchecker
+)
+qt_feature("webengine-extensions" PUBLIC
+ SECTION "WebEngine"
+ LABEL "Extensions"
+ PURPOSE "Enables Chromium extensions within certain limits. Currently used for enabling the pdf viewer."
+ AUTODETECT QT_FEATURE_webengine_printing_and_pdf
+ CONDITION QT_FEATURE_webengine_printing_and_pdf
+)
+qt_feature("webengine-webrtc" PRIVATE
+ LABEL "WebRTC"
+ PURPOSE "Provides WebRTC support."
+ AUTODETECT OFF
+)
+qt_feature("webengine-webrtc-pipewire" PRIVATE
+ LABEL "PipeWire over GIO"
+ PURPOSE "Provides PipeWire support in WebRTC using GIO."
+ AUTODETECT false
+ CONDITION QT_FEATURE_webengine_webrtc AND GIO_FOUND
+)
+qt_feature_config("webengine-full-debug-info" QMAKE_PRIVATE_CONFIG
+ NAME "v8base_debug"
+)
+qt_feature_config("webengine-full-debug-info" QMAKE_PRIVATE_CONFIG
+ NAME "webcore_debug"
+)
+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")
+qt_configure_add_summary_entry(ARGS "webengine-pepper-plugins")
+qt_configure_add_summary_entry(ARGS "webengine-printing-and-pdf")
+qt_configure_add_summary_entry(ARGS "webengine-proprietary-codecs")
+qt_configure_add_summary_entry(ARGS "webengine-spellchecker")
+qt_configure_add_summary_entry(ARGS "webengine-native-spellchecker")
+qt_configure_add_summary_entry(ARGS "webengine-webrtc")
+qt_configure_add_summary_entry(ARGS "webengine-webrtc-pipewire")
+qt_configure_add_summary_entry(ARGS "webengine-geolocation")
+qt_configure_add_summary_entry(ARGS "webengine-webchannel")
+qt_configure_add_summary_entry(ARGS "webengine-kerberos")
+qt_configure_add_summary_entry(ARGS "webengine-extensions")
+qt_configure_add_summary_entry(
+ ARGS "webengine-ozone-x11"
+ CONDITION UNIX
+)
+qt_configure_add_summary_entry(
+ ARGS "webengine-v8-snapshot-support"
+ CONDITION UNIX AND cross_compile
+)
+qt_configure_add_summary_entry(
+ ARGS "webengine-system-alsa"
+ CONDITION UNIX
+)
+qt_configure_add_summary_entry(
+ ARGS "webengine-system-pulseaudio"
+ CONDITION UNIX
+)
+qt_configure_end_summary_section() # end of "Qt WebEngineCore" section
+qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "Thumb instruction set is required to build ffmpeg for QtWebEngine."
+ CONDITION LINUX AND QT_FEATURE_webengine_embedded_build AND NOT QT_FEATURE_webengine_system_ffmpeg AND ( TEST_architecture_arch STREQUAL arm ) AND NOT QT_FEATURE_webengine_arm_thumb
+)
+qt_configure_add_report_entry(
+ TYPE WARNING
+ MESSAGE "V8 snapshot cannot be built. Most likely, the 32-bit host compiler does not work. Please make sure you have 32-bit devel environment installed."
+ CONDITION UNIX AND cross_compile AND NOT QT_FEATURE_webengine_v8_snapshot_support
+)