diff options
| author | Craig Scott <craig.scott@crascit.com> | 2021-01-29 23:22:45 +1100 |
|---|---|---|
| committer | Craig Scott <craig.scott@crascit.com> | 2021-02-05 07:33:38 +1100 |
| commit | 17e5516e608ba5c9c1f2dfad3d64f8f90874f108 (patch) | |
| tree | ae0f88a262c3734cda45ee1040aee303e131d13d /Tests/RunCMake/FetchContent | |
| parent | 4f3d1abbb4dca3d1e6b019471fa5d8be296492e3 (diff) | |
| download | cmake-17e5516e608ba5c9c1f2dfad3d64f8f90874f108.tar.gz | |
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/FetchContent')
| -rw-r--r-- | Tests/RunCMake/FetchContent/RunCMakeTest.cmake | 1 | ||||
| -rw-r--r-- | Tests/RunCMake/FetchContent/SameGenerator.cmake | 17 |
2 files changed, 0 insertions, 18 deletions
diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake index 9baeab75e2..b4973827a3 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 58204ef041..0000000000 --- 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() |
