diff options
author | Jeremy Kuhne <jeremy.kuhne@microsoft.com> | 2017-04-21 05:54:45 +0300 |
---|---|---|
committer | Dan Moseley <danmose@microsoft.com> | 2017-04-21 05:54:45 +0300 |
commit | c2d98347e4a0cbd5d4fe497cb4e7e7797e35502b (patch) | |
tree | 6a5484419f5a569a4ed658b763e6a11165b11525 /src | |
parent | 1c79b3e7492d69097ff23509dd75e2babc5dd872 (diff) |
Fix building with only VS2017 installed. (#18700)
We weren't passing the right setting to CMAKE.
Also fixes issue with current working directory getting changed during the build. Run.exe currently must be run
with the current working directory set to the repo root. One part of this was the config.json file- which I've explicitly specified now.
The other (as of yet unfixable) problem is that we specify the location of the binclash logger as a relative path. Afaik there currently is no way to make this happen with run.cmd without making this logger an explicit (as opposed to default) option. Could possibly extend run.exe's parsing to allow specifying environment variables or reference to other parameters...
I haven't nailed down who is changing the working directory- while it appears to be a 2017 specific problem I can't guarantee that it isn't some other variable.
Diffstat (limited to 'src')
-rw-r--r-- | src/Native/Windows/gen-buildsys-win.bat | 9 | ||||
-rw-r--r-- | src/Native/build-native.cmd | 8 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/Native/Windows/gen-buildsys-win.bat b/src/Native/Windows/gen-buildsys-win.bat index 3200919390..19f5b3e431 100644 --- a/src/Native/Windows/gen-buildsys-win.bat +++ b/src/Native/Windows/gen-buildsys-win.bat @@ -10,8 +10,13 @@ if %1=="/?" GOTO :USAGE setlocal set __sourceDir=%~dp0 + :: VS 2015 is the minimum supported toolset -set __VSString=14 2015 +if "%__VSVersion%" == "vs2017" ( + set __VSString=15 2017 +) else ( + set __VSString=14 2015 +) :: Set the target architecture to a format cmake understands. ANYCPU defaults to x64 if /i "%3" == "x86" (set __VSString=%__VSString%) @@ -35,7 +40,7 @@ GOTO :DONE echo "Usage..." echo "gen-buildsys-win.bat <path to top level CMakeLists.txt> <VSVersion> <Target Architecture" echo "Specify the path to the top level CMake file - <ProjectK>/src/NDP" - echo "Specify the VSVersion to be used - VS2013 or VS2015" + echo "Specify the VSVersion to be used - VS2015 or VS2017" echo "Specify the Target Architecture - x86, AnyCPU, ARM, or x64." EXIT /B 1 diff --git a/src/Native/build-native.cmd b/src/Native/build-native.cmd index 174feaa243..c2e6eccfb4 100644 --- a/src/Native/build-native.cmd +++ b/src/Native/build-native.cmd @@ -55,10 +55,10 @@ goto :Arg_Loop :: can be found. if not defined VisualStudioVersion ( if defined VS150COMNTOOLS ( - call "%VS150COMNTOOLS%\VsDevCmd.bat" + call "%VS150COMNTOOLS%VsDevCmd.bat" goto :VS2017 ) else if defined VS140COMNTOOLS ( - call "%VS140COMNTOOLS%\VsDevCmd.bat" + call "%VS140COMNTOOLS%VsDevCmd.bat" goto :VS2015 ) goto :MissingVersion @@ -82,7 +82,7 @@ set __VSVersion=vs2017 set __PlatformToolset=v141 if NOT "%__BuildArch%" == "arm64" ( :: Set the environment for the native build - call "%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch% + call "%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch% ) goto :SetupDirs @@ -92,7 +92,7 @@ set __VSVersion=vs2015 set __PlatformToolset=v140 if NOT "%__BuildArch%" == "arm64" ( :: Set the environment for the native build - call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %__VCBuildArch% + call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %__VCBuildArch% ) goto :SetupDirs |