summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-09-28 14:51:23 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-28 15:31:03 +0000
commit7ee686fbd9483beaac486a378239e1033060bcf8 (patch)
treeb0455585d4f71f234ceee1bd5e35f627fbc8e898
parent327c57bf84bd1331119fad1975653b9097db0d6d (diff)
Clean up build options
We can configure webenigne repository with FEATURE_qtpdf_build and FEATURE_qtwebegine_build so make them public. The handling is still affected by QTBUG-96936,however private vs public features will most likely get better handling soon. Fix build summary to better reflect build options. Change-Id: Ic6ef54a68b68d0f05c520a058665e6294efbe041 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit de15db17eccbc42d5d867973e7af3b95debff186) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--configure.cmake49
-rw-r--r--src/CMakeLists.txt37
-rw-r--r--src/webenginequick/CMakeLists.txt1
-rw-r--r--src/webenginequick/configure.cmake5
4 files changed, 52 insertions, 40 deletions
diff --git a/configure.cmake b/configure.cmake
index 37215abb0..c7b607e95 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -189,43 +189,47 @@ int main(void){
#### Features
-qt_feature("qtwebengine-build" PRIVATE
- LABEL "Build Qt WebEngine"
+qt_feature("qtwebengine-build" PUBLIC
+ LABEL "Build QtWebEngine Modules"
PURPOSE "Enables building the Qt WebEngine modules."
)
+qt_feature("qtwebengine-core-build" PRIVATE
+ LABEL "Build QtWebEngineCore"
+ PURPOSE "Enables building the Qt WebEngineCore module."
+ CONDITION QT_FEATURE_qtwebengine_build
+)
qt_feature("qtwebengine-widgets-build" PRIVATE
- LABEL "Build Qt WebEngineWidgets"
+ LABEL "Build QtWebEngineWidgets"
PURPOSE "Enables building the Qt WebEngineWidgets module."
- CONDITION TARGET Qt::Widgets
+ CONDITION TARGET Qt::Widgets AND QT_FEATURE_qtwebengine_build
)
qt_feature("qtwebengine-quick-build" PRIVATE
- LABEL "Build Qt WebEngineQuick"
+ LABEL "Build QtWebEngineQuick"
PURPOSE "Enables building the Qt WebEngineQuick module."
- CONDITION TARGET Qt::Quick AND TARGET Qt::Qml
+ CONDITION TARGET Qt::Quick AND TARGET Qt::Qml AND QT_FEATURE_qtwebengine_build
)
-qt_feature("qtpdf-build" PRIVATE
+qt_feature("qtpdf-build" PUBLIC
LABEL "Build Qt PDF"
PURPOSE "Enables building the Qt Pdf modules."
AUTODETECT FALSE
)
qt_feature("qtpdf-widgets-build" PRIVATE
- LABEL "Build Qt PdfWidgets"
+ LABEL "Build QtPdfWidgets"
PURPOSE "Enables building the Qt Pdf module."
- CONDITION TARGET Qt::Widgets
+ CONDITION TARGET Qt::Widgets AND QT_FEATURE_qtpdf_build
)
qt_feature("qtpdf-quick-build" PRIVATE
- LABEL "Build Qt PdfQuick"
- PURPOSE "Enables building the Qt Pdf module."
- CONDITION TARGET Qt::Quick AND TARGET Qt::Qml
+ LABEL "Build QtPdfQuick"
+ PURPOSE "Enables building the QtPdfQuick module."
+ CONDITION TARGET Qt::Quick AND TARGET Qt::Qml AND QT_FEATURE_qtpdf_build
)
qt_feature("webengine-system-ninja" PRIVATE
- LABEL "Use system ninja"
- CONDITION Ninja_FOUND
+ LABEL "Build Ninja"
+ AUTODETECT NOT Ninja_FOUND OR Ninja_EXECUTABLE MATCHES ${WEBENGINE_ROOT_BUILD_DIR}
)
qt_feature("webengine-system-gn" PRIVATE
- LABEL "Use system gn"
- AUTODETECT FALSE
- CONDITION Gn_FOUND
+ LABEL "Build Gn"
+ AUTODETECT NOT Gn_FOUND OR Gn_EXECUTABLE MATCHES ${WEBENGINE_ROOT_BUILD_DIR}
)
# default assumed merge limit (should match the one in qt_cmdline.cmake)
set(jumbo_merge_limit 8)
@@ -464,11 +468,20 @@ add_check_for_support(
#### Summary
# > Qt WebEngine Build Features
-qt_configure_add_summary_section(NAME "Qt WebEngine")
+qt_configure_add_summary_section(NAME "WebEngine Repository Build Options")
qt_configure_add_summary_entry(ARGS "webengine-system-ninja")
qt_configure_add_summary_entry(ARGS "webengine-system-gn")
qt_configure_add_summary_entry(ARGS "webengine-jumbo-build")
qt_configure_add_summary_entry(ARGS "webengine-developer-build")
+qt_configure_add_summary_section(NAME "Build QtWebEngine Modules")
+qt_configure_add_summary_entry(ARGS "qtwebengine-core-build")
+qt_configure_add_summary_entry(ARGS "qtwebengine-widgets-build")
+qt_configure_add_summary_entry(ARGS "qtwebengine-quick-build")
+qt_configure_end_summary_section()
+qt_configure_add_summary_section(NAME "Build QtPdf Modules")
+qt_configure_add_summary_entry(ARGS "qtpdf-widgets-build")
+qt_configure_add_summary_entry(ARGS "qtpdf-quick-build")
+qt_configure_end_summary_section()
# >> Optional system libraries
if(UNIX)
qt_configure_add_summary_section(NAME "Optional system libraries")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 501a687f1..5ba4cb1c6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,6 +18,10 @@ qt_feature_module_end(ONLY_EVALUATE_FEATURES)
# SUPPORT CHECK
##
+# TODO: here we should return FATAL_ERROR and ask user to define
+# FEATURE_qtwebenignebuild=OFF if one wants to only build qtpdf,
+# however our ci setup is not flexible enough and configure step must succeed
+
if(NOT ${QtWebEngine_SUPPORT})
add_custom_target(WebEngineErrorMessage ALL
${CMAKE_COMMAND} -E cmake_echo_color --red "QtWebEngine will not be built: ${QtWebEngine_ERROR}"
@@ -25,7 +29,11 @@ if(NOT ${QtWebEngine_SUPPORT})
VERBATIM
)
message("-- Support check for QtWebEngine failed: ${QtWebEngine_ERROR}")
- set(QT_FEATURE_qtwebengine_build OFF CACHE BOOL "Build QtWebEngine" FORCE)
+ set(QT_FEATURE_qtwebengine_build OFF CACHE BOOL "Build QtWebEngine Modules" FORCE)
+ set(QT_FEATURE_qtwebengine_core_build OFF CACHE BOOL "Build QtWebEngineCore" FORCE)
+ set(QT_FEATURE_qtwebengine_widgets_build OFF CACHE BOOL "Build QtWebEngineWidgets" FORCE)
+ set(QT_FEATURE_qtwebengine_quick_build OFF CACHE BOOL "Build QtWebEngineQuick" FORCE)
+
endif()
if(NOT ${QtPdf_SUPPORT})
@@ -44,29 +52,25 @@ if(NOT QT_FEATURE_qtwebengine_build AND NOT QT_FEATURE_qtpdf_build)
return()
endif()
-if(NOT QT_FEATURE_qtwebengine_build)
- set(QT_FEATURE_qtwebengine_widgets_build OFF CACHE BOOL "Build QtWebEngineWidgets" FORCE)
- set(QT_FEATURE_qtwebengine_quick_build OFF CACHE BOOL "Build QtWebEngineQuick" FORCE)
-endif()
-
##
# MODULES
##
-if(QT_FEATURE_qtwebengine_build)
+if(QT_FEATURE_qtwebengine_core_build)
add_subdirectory(core)
add_subdirectory(process)
- if(QT_FEATURE_qtwebengine_widgets_build)
- add_subdirectory(webenginewidgets)
- endif()
- if(QT_FEATURE_qtwebengine_quick_build)
- add_subdirectory(webenginequick)
- endif()
endif()
+if(QT_FEATURE_qtwebengine_widgets_build)
+ add_subdirectory(webenginewidgets)
+endif()
+if(QT_FEATURE_qtwebengine_quick_build)
+ add_subdirectory(webenginequick)
+endif()
+
if(QT_FEATURE_qtpdf_build)
add_subdirectory(pdf)
# keep log order, pdf build after webengine
- if(QT_FEATURE_qtwebengine_build)
+ if(QT_FEATURE_qtwebengine_core_build)
add_dependencies(run_pdf_GnReady WebEngineCore)
endif()
if(QT_FEATURE_qtwebengine_widgets_build)
@@ -101,7 +105,7 @@ if(NOT Ninja_FOUND)
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
)
- if(QT_FEATURE_qtwebengine_build)
+ if(QT_FEATURE_qtwebengine_core_build)
add_dependencies(run_core_NinjaReady ninja)
endif()
if(QT_FEATURE_qtpdf_build)
@@ -128,7 +132,7 @@ if(NOT Gn_FOUND)
-DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
-DWEBENGINE_ROOT_BUILD_DIR=${PROJECT_BINARY_DIR}
)
- if(QT_FEATURE_qtwebengine_build)
+ if(QT_FEATURE_qtwebengine_core_build)
add_dependencies(run_core_GnReady gn)
endif()
if(QT_FEATURE_qtpdf_build)
@@ -173,7 +177,6 @@ endif()
# install gn for cross build
if(LINUX AND INSTALL_GN)
get_install_config(installConfig)
- message(${installConfig})
install(
PROGRAMS ${installDir}/bin/gn
CONFIGURATIONS ${installConfig}
diff --git a/src/webenginequick/CMakeLists.txt b/src/webenginequick/CMakeLists.txt
index 30b0fa2cf..7cadf602c 100644
--- a/src/webenginequick/CMakeLists.txt
+++ b/src/webenginequick/CMakeLists.txt
@@ -55,3 +55,4 @@ qt_internal_extend_target(qtwebenginequickplugin
Qt::CorePrivate
Qt::WebEngineQuickPrivate
)
+
diff --git a/src/webenginequick/configure.cmake b/src/webenginequick/configure.cmake
index 683a3f383..649154301 100644
--- a/src/webenginequick/configure.cmake
+++ b/src/webenginequick/configure.cmake
@@ -1,12 +1,7 @@
-qt_feature("webenginequick-qml" PRIVATE
- LABEL "Support Qt WebEngine Qml"
- PURPOSE "Provides WebEngine Qml support."
-)
qt_feature("webenginequick-ui-delegates" PRIVATE
SECTION "WebEngine"
LABEL "UI Delegates"
)
qt_configure_add_summary_section(NAME "Qt WebEngineQuick")
-qt_configure_add_summary_entry(ARGS "webenginequick-qml")
qt_configure_add_summary_entry(ARGS "webenginequick-ui-delegates")
qt_configure_end_summary_section()