From 15c6593db2e28b4c2d2d72aaa58c65dcb12cfa9b Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Fri, 16 Nov 2018 07:14:11 -0800 Subject: [PATCH] Eliminate CMAKE dependency when not required (#21040) --- build-test.cmd | 4 ++-- build.cmd | 9 +++++++-- src/pal/tools/gen-buildsys-win.bat | 4 ++-- src/pal/tools/{probe-win.ps1 => set-cmake-path.ps1} | 0 4 files changed, 11 insertions(+), 6 deletions(-) rename src/pal/tools/{probe-win.ps1 => set-cmake-path.ps1} (100%) diff --git a/build-test.cmd b/build-test.cmd index 790b75f..17ce589 100644 --- a/build-test.cmd +++ b/build-test.cmd @@ -164,8 +164,8 @@ if not exist "%__LogsDir%" md "%__LogsDir%" echo %__MsgPrefix%Checking prerequisites -REM Eval the output from probe-win1.ps1 -for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a +REM Eval the output from set-cmake-path.ps1 +for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\set-cmake-path.ps1"""') do %%a REM ========================================================================================= REM === diff --git a/build.cmd b/build.cmd index 75afd3e..781ed9f 100644 --- a/build.cmd +++ b/build.cmd @@ -320,8 +320,13 @@ REM Set the remaining variables based upon the determined build configuration echo %__MsgPrefix%Checking prerequisites -REM Eval the output from probe-win1.ps1 -for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a +set __CMakeNeeded=1 +if %__BuildNative%==0 if %__BuildNativeCoreLib%==0 if %__BuildTests%==0 set __CMakeNeeded=0 +if %__CMakeNeeded%==1 ( + REM Eval the output from set-cmake-path.ps1 + for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\set-cmake-path.ps1"""') do %%a + REM echo Using CMake from %CMakePath% +) REM NumberOfCores is an WMI property providing number of physical cores on machine REM processor(s). It is used to set optimal level of CL parallelism during native build step diff --git a/src/pal/tools/gen-buildsys-win.bat b/src/pal/tools/gen-buildsys-win.bat index 221d322..f542e99 100644 --- a/src/pal/tools/gen-buildsys-win.bat +++ b/src/pal/tools/gen-buildsys-win.bat @@ -36,8 +36,8 @@ goto loop if defined CMakePath goto DoGen -:: Eval the output from probe-win1.ps1 -for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& "%basePath%\probe-win.ps1""') do %%a +:: Eval the output from set-cmake-path.ps1 +for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& "%basePath%\set-cmake-path.ps1""') do %%a :DoGen "%CMakePath%" "-DCMAKE_USER_MAKE_RULES_OVERRIDE=%basePath%\windows-compiler-override.txt" "-DCMAKE_INSTALL_PREFIX:PATH=$ENV{__CMakeBinDir}" "-DCLR_CMAKE_HOST_ARCH=%__Arch%" %__ExtraCmakeParams% -G "%__CmakeGenerator%" %__SourceDir% diff --git a/src/pal/tools/probe-win.ps1 b/src/pal/tools/set-cmake-path.ps1 similarity index 100% rename from src/pal/tools/probe-win.ps1 rename to src/pal/tools/set-cmake-path.ps1 -- 2.7.4