summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-01-29 12:22:45 (GMT)
committerCraig Scott <craig.scott@crascit.com>2021-02-04 20:33:38 (GMT)
commit17e5516e608ba5c9c1f2dfad3d64f8f90874f108 (patch)
treeae0f88a262c3734cda45ee1040aee303e131d13d /Tests/RunCMake
parent4f3d1abbb4dca3d1e6b019471fa5d8be296492e3 (diff)
downloadCMake-17e5516e608ba5c9c1f2dfad3d64f8f90874f108.zip
CMake-17e5516e608ba5c9c1f2dfad3d64f8f90874f108.tar.gz
CMake-17e5516e608ba5c9c1f2dfad3d64f8f90874f108.tar.bz2
FetchContent: Invoke steps directly and avoid a separate sub-build
The cost of setting up and executing a separate sub-build to do the download, update and patch steps required for FetchContent population can be significant with some platforms and CMake generators. Avoid the sub-build altogether by invoking the step scripts directly. Previously, if no generator was set (e.g. population was being done in script mode), a generator needed to be available on the default PATH. Since we no longer use a sub-build, this restriction is also now gone. Fixes: #21703
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/FetchContent/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/FetchContent/SameGenerator.cmake17
2 files changed, 0 insertions, 18 deletions
diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
index 9baeab7..b497382 100644
--- a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
@@ -7,7 +7,6 @@ run_cmake(DirectIgnoresDetails)
run_cmake(FirstDetailsWin)
run_cmake(DownloadTwice)
run_cmake(DownloadFile)
-run_cmake(SameGenerator)
run_cmake(VarDefinitions)
run_cmake(GetProperties)
run_cmake(UsesTerminalOverride)
diff --git a/Tests/RunCMake/FetchContent/SameGenerator.cmake b/Tests/RunCMake/FetchContent/SameGenerator.cmake
deleted file mode 100644
index 58204ef..0000000
--- a/Tests/RunCMake/FetchContent/SameGenerator.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-include(FetchContent)
-
-FetchContent_Declare(
- t1
- DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Download command executed"
-)
-
-FetchContent_Populate(t1)
-
-file(STRINGS "${FETCHCONTENT_BASE_DIR}/t1-subbuild/CMakeCache.txt"
- matchLine REGEX "^CMAKE_GENERATOR:.*="
- LIMIT_COUNT 1
-)
-if(NOT matchLine MATCHES "${CMAKE_GENERATOR}")
- message(FATAL_ERROR "Generator line mismatch: ${matchLine}\n"
- " Expected type: ${CMAKE_GENERATOR}")
-endif()