tools/cmake: pass -DBUILD_TESTING=OFF to bootstrap

Instead of carrying 100-no-testing.patch, pass -DBUILD_TESTING=OFF
directly to CMake's bootstrap script. This avoids refreshing the patch
on every CMake update.

The patch also changed the default in the installed CTest.cmake module.
Preserve that behavior by passing -DBUILD_TESTING=OFF by default in
cmake.mk for target and host builds. Packages can override it via
CMAKE_OPTIONS or CMAKE_HOST_OPTIONS.

OpenWrt never runs CMake tests, so building them only wastes build time.

This replaces the patch introduced in 8af80e79bd ("tools/cmake:
update to 3.17.0").

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24403
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Josef Schlehofer authored and Robert Marko committed 2026-09-23 16:29:25 +02:00
1 parent ad71bfef7e
commit ddb23f3a02
3 files changed
+4 -34

No files matched your search

+2
View File
@@ -127,6 +127,7 @@ define Build/Configure/Default
-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE \
-DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=FALSE \
-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=TRUE \
-DBUILD_TESTING=OFF \
$(CMAKE_OPTIONS) \
$(CMAKE_SOURCE_DIR) \
)
@@ -175,6 +176,7 @@ define Host/Configure/Default
-DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=FALSE \
-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=TRUE \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
$(CMAKE_HOST_OPTIONS) \
$(HOST_CMAKE_SOURCE_DIR) \
)
+2 -1
View File
@@ -37,7 +37,8 @@ HOST_CONFIGURE_ARGS := \
--system-liblzma \
--system-zlib \
--system-zstd \
--generator=Ninja
--generator=Ninja \
-- -DBUILD_TESTING=OFF
CMAKE_HOST_OPTIONS = \
-DZSTD_INCLUDE_DIR="$(STAGING_DIR_HOST)/include" \
-33
View File
@@ -1,33 +0,0 @@
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -60,7 +60,7 @@ the :variable:`CTEST_USE_LAUNCHERS` vari
in the ``CTestConfig.cmake`` file.
#]=======================================================================]
-option(BUILD_TESTING "Build the testing tree." ON)
+option(BUILD_TESTING "Build the testing tree." OFF)
# function to turn generator name into a version string
# like vs9 or vs10
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -46,7 +46,7 @@ if(cmp0145 STREQUAL "")
cmake_policy(ISSUE_WARNING CMP0145)
endif()
-option(BUILD_TESTING "Build the testing tree." ON)
+option(BUILD_TESTING "Build the testing tree." OFF)
if(BUILD_TESTING)
# We only get here if a project already ran include(Dart),
--- a/Tests/Contracts/VTK/Dashboard.cmake.in
+++ b/Tests/Contracts/VTK/Dashboard.cmake.in
@@ -25,7 +25,7 @@ ctest_empty_binary_directory(${CTEST_BIN
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
VTK_BUILD_EXAMPLES:BOOL=ON
- VTK_BUILD_TESTING:STRING=WANT
+ VTK_BUILD_TESTING:STRING=OFF
VTK_WRAP_PYTHON:BOOL=ON
ExternalData_OBJECT_STORES:FILEPATH=@base_dir@/ExternalData
")