From c97895e0843db3fa9ac3b029262dc86e1504849c Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 13 Sep 2021 08:37:24 +0200 Subject: Add matrix builds Since coin does not support doing matrix projects, add primitive way to automate features builds. Add self build launcher in form of external projects to do few builds one after the other which test some of our features. These are just compilation tests and could also run in coin as scheduled build. Usage: /path/to/qt-cmake-private /path/to/webenginesources -DMATRIX_BUILD=ON Created currently builds: * webengine_extensions-OFF * webengine_printing_and_pdf-OFF * webengine_proprietary_codecs-ON * webengine_spellchecker-OFF * webengine_webrtc-OFF * qtwebengine_build-OFF Pick-to: 6.2 Change-Id: Ie1bbc2cf9b01cb2e5089832d8f1cd6171e31b6fe Reviewed-by: Allan Sandfeld Jensen --- cmake/Functions.cmake | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'cmake') 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() -- cgit v1.2.1