summaryrefslogtreecommitdiff
path: root/configure.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-04-07 15:12:07 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2022-04-08 23:16:08 +0200
commitf923582e8b2d73c6d05860652fb79e12784edaa5 (patch)
tree485e57f445c8369a9b4af403bb616fb2868ae442 /configure.cmake
parentd909c0efba034677d493c6785a4392a433359577 (diff)
downloadqtwebengine-f923582e8b2d73c6d05860652fb79e12784edaa5.tar.gz
Fix detection of then webengine-system-[gn|ninja] features
Regexp matching against the build dir fails if the build dir contains characters that would form a regular expression. Worse, the regex could be malformed, and configuration would abort. Also, renamed the features from webengine-system-* to webengine-build-* to reflect what they are actually used for. Pick-to: 6.2 6.3 Task-number: QTBUG-102323 Change-Id: I1b5f2bb156aaa7797fc059517a0d18c7d1cf9fd6 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'configure.cmake')
-rw-r--r--configure.cmake34
1 files changed, 27 insertions, 7 deletions
diff --git a/configure.cmake b/configure.cmake
index 106fe86d9..5b7a9b03a 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1,4 +1,3 @@
-
if(QT_CONFIGURE_RUNNING)
function(assertTargets)
endfunction()
@@ -236,13 +235,34 @@ qt_feature("qtpdf-quick-build" PRIVATE
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
+
+function(qtwebengine_internal_is_file_inside_root_build_dir out_var file)
+ set(result ON)
+ if(NOT QT_CONFIGURE_RUNNING)
+ file(RELATIVE_PATH relpath "${WEBENGINE_ROOT_BUILD_DIR}" "${file}")
+ if(IS_ABSOLUTE "${relpath}" OR relpath MATCHES "^\\.\\./")
+ set(result OFF)
+ endif()
+ endif()
+ set(${out_var} ${result} PARENT_SCOPE)
+endfunction()
+
+if(Ninja_FOUND)
+ qtwebengine_internal_is_file_inside_root_build_dir(
+ Ninja_INSIDE_WEBENGINE_ROOT_BUILD_DIR "${Ninja_EXECUTABLE}")
+endif()
+qt_feature("webengine-build-ninja" PRIVATE
LABEL "Build Ninja"
- AUTODETECT NOT Ninja_FOUND OR Ninja_EXECUTABLE MATCHES ${WEBENGINE_ROOT_BUILD_DIR}
+ AUTODETECT NOT Ninja_FOUND OR Ninja_INSIDE_WEBENGINE_ROOT_BUILD_DIR
)
-qt_feature("webengine-system-gn" PRIVATE
+
+if(Gn_FOUND)
+ qtwebengine_internal_is_file_inside_root_build_dir(
+ Gn_INSIDE_WEBENGINE_ROOT_BUILD_DIR "${Gn_EXECUTABLE}")
+endif()
+qt_feature("webengine-build-gn" PRIVATE
LABEL "Build Gn"
- AUTODETECT NOT Gn_FOUND OR Gn_EXECUTABLE MATCHES ${WEBENGINE_ROOT_BUILD_DIR}
+ AUTODETECT NOT Gn_FOUND OR Gn_INSIDE_WEBENGINE_ROOT_BUILD_DIR
)
# default assumed merge limit (should match the one in qt_cmdline.cmake)
set(jumbo_merge_limit 8)
@@ -550,8 +570,8 @@ endif()
# > Qt WebEngine Build Features
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-build-ninja")
+qt_configure_add_summary_entry(ARGS "webengine-build-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")