Disable caching in find_program (#72250)
authorAdeel Mujahid <3840695+am11@users.noreply.github.com>
Fri, 15 Jul 2022 14:19:08 +0000 (17:19 +0300)
committerGitHub <noreply@github.com>
Fri, 15 Jul 2022 14:19:08 +0000 (16:19 +0200)
Unblocks #71725.
Followup: #71742

Prior to #71742, we were calling `locate_toolchain_exec` once per tool. Calling it twice with different prefix gives us the old result, which is something we don't want (we only call this local function a few times in this file, and each time for intention to "lookup" the executable).

eng/native/configuretools.cmake

index 4f9361c..9024cb0 100644 (file)
@@ -29,6 +29,7 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER)
     endif()
 
     find_program(EXEC_LOCATION_${exec}
+      NO_CACHE
       NAMES
       "${TOOLSET_PREFIX}${exec}${CLR_CMAKE_COMPILER_FILE_NAME_VERSION}"
       "${TOOLSET_PREFIX}${exec}")