summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt11
-rw-r--r--cmake/Functions.cmake32
2 files changed, 43 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4202eaeec..35248b6f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,5 +16,16 @@ find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS
Gui Widgets Network OpenGL Quick Qml PrintSupport
WebChannel Positioning QuickControls2 Test QuickWidgets QuickTest WebSockets Designer
)
+
+if(MATRIX_BUILD AND NOT MATRIX_SUBBUILD AND NOT QT_SUPERBUILD)
+ add_build(webengine_webrtc OFF)
+ add_build(webengine_proprietary_codecs ON)
+ add_build(webengine_printing_and_pdf OFF)
+ add_build(webengine_extensions OFF)
+ add_build(webengine_spellchecker OFF)
+ add_build(qtwebengine_build OFF)
+ return()
+endif()
+
set(WEBENGINE_MODULE_BUILD TRUE)
qt_build_repo()
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 37fd593a9..19d6b0ca0 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -1054,3 +1054,35 @@ function(check_for_ulimit)
endif()
endif()
endfunction()
+
+function(add_build feature value)
+ list(APPEND cmakeArgs
+ "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}"
+ "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
+ "-DMATRIX_SUBBUILD=ON"
+ "-DFEATURE_${feature}=${value}"
+ )
+ if(CMAKE_C_COMPILER_LAUNCHER)
+ list(APPEND cmakeArgs "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}")
+ endif()
+ if(CMAKE_CXX_COMPILER_LAUNCHER)
+ list(APPEND cmakeArgs "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}")
+ endif()
+
+ externalproject_add(${feature}
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${feature}-${value}
+ PREFIX ${feature}-${value}
+ CMAKE_ARGS ${cmakeArgs}
+ USES_TERMINAL_BUILD ON
+ USES_TERMINAL_CONFIGURE ON
+ BUILD_ALWAYS TRUE
+ INSTALL_COMMAND ""
+ )
+ get_property(depTracker GLOBAL PROPERTY MATRIX_DEPENDENCY_TRACKER)
+ foreach(dep ${depTracker})
+ add_dependencies(${feature} ${dep})
+ endforeach()
+ set(depTracker "${depTracker}" ${feature})
+ set_property(GLOBAL PROPERTY MATRIX_DEPENDENCY_TRACKER "${depTracker}")
+endfunction()