From 11d21c1c4e7028570e78c134b36187dbf03aaa4e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 22 Oct 2020 10:20:45 -0400 Subject: CTest: Avoid invoking external tool to get the host name Populate the SITE cache entry using an internal query instead. --- Modules/CTest.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 8109108..ca9fcf5 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -194,7 +194,14 @@ if(BUILD_TESTING) "Extra command line flags to pass to the coverage tool") # set the site name - site_name(SITE) + if(COMMAND cmake_host_system_information) + cmake_host_system_information(RESULT _ctest_hostname QUERY HOSTNAME) + set(SITE "${_ctest_hostname}" CACHE STRING "Name of the computer/site where compile is being run") + unset(_ctest_hostname) + else() + # This code path is needed for CMake itself during bootstrap. + site_name(SITE) + endif() # set the build name if(NOT BUILDNAME) set(DART_COMPILER "${CMAKE_CXX_COMPILER}") -- cgit v0.12