diff --git a/docs/README.Windows.md b/docs/README.Windows.md index f6a6ea65a6622..7609e94584b13 100644 --- a/docs/README.Windows.md +++ b/docs/README.Windows.md @@ -198,30 +198,42 @@ cd kodi-build Configure build for 64bit (**recommended**): ``` -cmake -G "Visual Studio 15 Win64" -T host=x64 %userprofile%\kodi +cmake -G "Visual Studio 15 2017" -A x64 -T host=x64 %userprofile%\kodi ``` Or configure build for 32bit: ``` -cmake -G "Visual Studio 15" -T host=x64 %userprofile%\kodi +cmake -G "Visual Studio 15 2017" -A Win32 -T host=x64 %userprofile%\kodi ``` Or configure build for UWP 64bit: ``` -cmake -G "Visual Studio 15 Win64" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -T host=x64 %userprofile%\kodi +cmake -G "Visual Studio 15 2017" -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -T host=x64 %userprofile%\kodi ``` Or configure build for UWP 32bit: ``` -cmake -G "Visual Studio 15" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -T host=x64 %userprofile%\kodi +cmake -G "Visual Studio 15 2017" -A Win32 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -T host=x64 %userprofile%\kodi ``` Or configure build for UWP ARM 32bit: ``` -cmake -G "Visual Studio 15 ARM" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -T host=x64 %userprofile%\kodi +cmake -G "Visual Studio 15 2017" -A ARM -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -T host=x64 %userprofile%\kodi ``` -**WARNING:** `-T host=x64` requires CMake version >= 3.8. If your version is older, drop `-T host=x64` from the command. +**Visual Studio 2019:** + +Replace: +``` +-G "Visual Studio 15 2017" +``` + +With: +``` +-G "Visual Studio 16 2019" +``` + +**WARNING:** Is required CMake version >= 3.8. Build Kodi: Build a `Debug` binary: diff --git a/tools/buildsteps/windows/BuildSetup.bat b/tools/buildsteps/windows/BuildSetup.bat index 6e1aca3e86129..45ba7c0a489b7 100644 --- a/tools/buildsteps/windows/BuildSetup.bat +++ b/tools/buildsteps/windows/BuildSetup.bat @@ -84,7 +84,7 @@ set WORKSPACE=%base_dir%\kodi-build.%TARGET_PLATFORM% MKDIR %WORKSPACE% PUSHD %WORKSPACE% - cmake.exe -G "%cmakeGenerator%" %cmakeProps% %base_dir% + cmake.exe -G "%cmakeGenerator%" -A %cmakeArch% -T host=x64 %cmakeProps% %base_dir% IF %errorlevel%==1 ( set DIETEXT="%APP_NAME%.EXE failed to build!" goto DIE diff --git a/tools/buildsteps/windows/arm-uwp/BuildSetup.bat b/tools/buildsteps/windows/arm-uwp/BuildSetup.bat index 18b3ecf86c3d9..8fd6e03de18f2 100644 --- a/tools/buildsteps/windows/arm-uwp/BuildSetup.bat +++ b/tools/buildsteps/windows/arm-uwp/BuildSetup.bat @@ -9,7 +9,8 @@ IF ERRORLEVEL 1 ( EXIT /B 1 ) -SET cmakeGenerator=Visual Studio %vsver% ARM +SET cmakeGenerator=Visual Studio %vsver% +SET cmakeArch=ARM SET TARGET_ARCHITECTURE=arm SET TARGET_PLATFORM=%TARGET_ARCHITECTURE%-uwp SET cmakeProps=-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=%UCRTVersion% diff --git a/tools/buildsteps/windows/vswhere.bat b/tools/buildsteps/windows/vswhere.bat index f7b132bb37f1b..97c2594ff4350 100644 --- a/tools/buildsteps/windows/vswhere.bat +++ b/tools/buildsteps/windows/vswhere.bat @@ -47,7 +47,9 @@ SET vswhere="%builddeps%\%toolsdir%\tools\vswhere\vswhere.exe" FOR /f "usebackq tokens=1* delims=" %%i in (`%vswhere% -latest -property installationPath`) do ( IF EXIST "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( SET vcvars="%%i\VC\Auxiliary\Build\vcvarsall.bat" - SET vsver=15 + SET vsver=15 2017 + ECHO %%i | findstr "2019" >NUL 2>NUL + IF NOT ERRORLEVEL 1 SET vsver=16 2019 ) ) @@ -57,7 +59,7 @@ IF %vcvars%==no ( IF NOT ERRORLEVEL 1 ( IF EXIST "%%i\VC\vcvarsall.bat" ( SET vcvars="%%i\VC\vcvarsall.bat" - SET vsver=14 + SET vsver=14 2015 ) ) ) diff --git a/tools/buildsteps/windows/win32-uwp/BuildSetup.bat b/tools/buildsteps/windows/win32-uwp/BuildSetup.bat index 3aba2378f1622..5ddf234b578fd 100644 --- a/tools/buildsteps/windows/win32-uwp/BuildSetup.bat +++ b/tools/buildsteps/windows/win32-uwp/BuildSetup.bat @@ -9,6 +9,7 @@ IF ERRORLEVEL 1 ( ) SET cmakeGenerator=Visual Studio %vsver% +SET cmakeArch=Win32 SET TARGET_ARCHITECTURE=x86 SET TARGET_PLATFORM=win32-uwp SET cmakeProps=-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=%UCRTVersion% diff --git a/tools/buildsteps/windows/win32/BuildSetup.bat b/tools/buildsteps/windows/win32/BuildSetup.bat index 70764985ba7ab..0c10f4336c842 100644 --- a/tools/buildsteps/windows/win32/BuildSetup.bat +++ b/tools/buildsteps/windows/win32/BuildSetup.bat @@ -10,6 +10,7 @@ IF ERRORLEVEL 1 ( ) SET cmakeGenerator=Visual Studio %vsver% +SET cmakeArch=Win32 SET TARGET_ARCHITECTURE=x86 SET TARGET_PLATFORM=%TARGET_ARCHITECTURE% diff --git a/tools/buildsteps/windows/x64-uwp/BuildSetup.bat b/tools/buildsteps/windows/x64-uwp/BuildSetup.bat index 037c536b809a0..8144248dd013e 100644 --- a/tools/buildsteps/windows/x64-uwp/BuildSetup.bat +++ b/tools/buildsteps/windows/x64-uwp/BuildSetup.bat @@ -8,7 +8,8 @@ IF ERRORLEVEL 1 ( EXIT /B 1 ) -SET cmakeGenerator=Visual Studio %vsver% Win64 +SET cmakeGenerator=Visual Studio %vsver% +SET cmakeArch=x64 SET TARGET_ARCHITECTURE=x64 SET TARGET_PLATFORM=%TARGET_ARCHITECTURE%-uwp SET cmakeProps=-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=%UCRTVersion% diff --git a/tools/buildsteps/windows/x64/BuildSetup.bat b/tools/buildsteps/windows/x64/BuildSetup.bat index 6434d3f0c09bb..09acf3faa1827 100644 --- a/tools/buildsteps/windows/x64/BuildSetup.bat +++ b/tools/buildsteps/windows/x64/BuildSetup.bat @@ -8,7 +8,8 @@ IF ERRORLEVEL 1 ( EXIT /B 1 ) -SET cmakeGenerator=Visual Studio %vsver% Win64 +SET cmakeGenerator=Visual Studio %vsver% +SET cmakeArch=x64 SET TARGET_ARCHITECTURE=x64 SET TARGET_PLATFORM=%TARGET_ARCHITECTURE%