Skip to content

Commit e4a7d2a

Browse files
Stinkfist0aothms
authored andcommitted
Windows/MSVC build scripts: support for VS 2017 CMake generators, update Boost to 1.63.0, update ICU download to 58.2 in order to have VS 2107 download available, configure Boost using generic MSVC instead of specific version, make sure to 'git fetch' before 'git checkout <revision>'.
1 parent 0f993b3 commit e4a7d2a

3 files changed

Lines changed: 30 additions & 22 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Prerequisites
1313
-------------
1414
* Git
1515
* CMake (2.6 or newer)
16-
* Windows: [Visual Studio] 2008 or newer (2017 not yet officially supported) with C++ toolset (or [Visual C++ Build Tools]) or [MSYS2] + MinGW
16+
* Windows: [Visual Studio] 2008 or newer with C++ toolset (or [Visual C++ Build Tools]) or [MSYS2] + MinGW
1717
* *nix: GCC 4.7 or newer, or Clang (any version)
1818

1919
Dependencies

win/build-deps.cmd

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ cd "%DEPS_DIR%"
139139
:: Note all of the depedencies have approriate label so that user can easily skip something if wanted
140140
:: by modifying this file and using goto.
141141
:Boost
142-
set BOOST_VERSION=1.59.0
142+
set BOOST_VERSION=1.63.0
143143
:: DEPENDENCY_NAME is used for logging and DEPENDENCY_DIR for saving from some redundant typing
144144
set DEPENDENCY_NAME=Boost %BOOST_VERSION%
145145
set DEPENDENCY_DIR="%DEPS_DIR%\boost"
@@ -159,13 +159,13 @@ call :ExtractArchive %BOOST_ZIP% "%DEPS_DIR%" "%DEPS_DIR%\boost"
159159
IF NOT %ERRORLEVEL%==0 GOTO :Error
160160

161161
:: Build Boost build script
162-
IF EXIST "%DEPS_DIR%\boost_%BOOST_VER%". (
162+
if not exist "%DEPS_DIR%\boost\project-config.jam". (
163163
cd "%DEPS_DIR%"
164164
ren boost_%BOOST_VER% boost
165165
IF NOT EXIST "%DEPS_DIR%\boost\boost.css" GOTO :Error
166166
cd "%DEPS_DIR%\boost"
167167
call cecho.cmd 0 13 "Building Boost build script."
168-
call bootstrap vc%VC_VER%
168+
call bootstrap msvc
169169
IF NOT %ERRORLEVEL%==0 GOTO :Error
170170
)
171171

@@ -174,38 +174,40 @@ set BOOST_LIBS=--with-system --with-regex --with-thread --with-program_options -
174174
cd "%DEPS_DIR%\boost"
175175
call cecho.cmd 0 13 "Building %DEPENDENCY_NAME% %BOOST_LIBS% Please be patient, this will take a while."
176176
IF EXIST "%DEPS_DIR%\boost\bin.v2\project-cache.jam" del "%DEPS_DIR%\boost\bin.v2\project-cache.jam"
177-
call .\b2 toolset=msvc-%VC_VER%.0 runtime-link=static address-model=%ARCH_BITS% -j%IFCOS_NUM_BUILD_PROCS% ^
177+
call .\b2 toolset=msvc runtime-link=static address-model=%ARCH_BITS% -j%IFCOS_NUM_BUILD_PROCS% ^
178178
variant=%DEBUG_OR_RELEASE_LOWERCASE% %BOOST_LIBS% stage --stagedir=stage/vs%VS_VER%-%VS_PLATFORM%
179179
IF NOT %ERRORLEVEL%==0 GOTO :Error
180180

181181
:ICU
182182
set DEPENDENCY_NAME=ICU
183183
set DEPENDENCY_DIR=N/A
184-
set ICU_ZIP=icu-55.1-vs%VS_VER%.7z
184+
set ICU_VER=58.2
185+
set ICU_ZIP=icu-%ICU_VER%-vs%VS_VER%.7z
185186
cd "%DEPS_DIR%"
186187
call :DownloadFile http://www.npcglib.org/~stathis/downloads/%ICU_ZIP% "%DEPS_DIR%" %ICU_ZIP%
187188
IF NOT %ERRORLEVEL%==0 GOTO :Error
188189
call :ExtractArchive %ICU_ZIP% "%DEPS_DIR%" "%INSTALL_DIR%\icu"
189190
IF NOT %ERRORLEVEL%==0 GOTO :Error
190191
:: Rename lib and bin directories to predictable form
191-
IF EXIST "%DEPS_DIR%\icu-55.1-vs%VS_VER%". (
192-
pushd "%DEPS_DIR%\icu-55.1-vs%VS_VER%"
192+
IF EXIST "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%". (
193+
pushd "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%"
193194
IF EXIST bin. ren bin bin%ARCH_BITS%"
194195
IF EXIST lib. ren lib lib%ARCH_BITS%"
195196
popd
196197
)
197198

198-
IF EXIST "%DEPS_DIR%\icu-55.1-vs%VS_VER%\". (
199-
robocopy "%DEPS_DIR%\icu-55.1-vs%VS_VER%\include" "%INSTALL_DIR%\icu\include" /E /IS /njh /njs
199+
IF EXIST "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\". (
200+
robocopy "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\include" "%INSTALL_DIR%\icu\include" /E /IS /njh /njs
200201
IF NOT EXIST "%INSTALL_DIR%\icu\lib". mkdir "%INSTALL_DIR%\icu\lib"
201-
copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicutest%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icutest%POSTFIX_D%.lib"
202-
copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicutu%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icutu%POSTFIX_D%.lib"
203-
copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicuuc%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuuc%POSTFIX_D%.lib"
204-
copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicudt%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icudt%POSTFIX_D%.lib"
205-
copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicuin%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuin%POSTFIX_D%.lib"
206-
copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicuio%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuio%POSTFIX_D%.lib"
207-
copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\sicule%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icule%POSTFIX_D%.lib"
208-
copy /y "%DEPS_DIR%\icu-55.1-vs%VS_VER%\lib%ARCH_BITS%\siculx%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\iculx%POSTFIX_D%.lib"
202+
copy /y "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\lib%ARCH_BITS%\sicutest%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icutest%POSTFIX_D%.lib"
203+
copy /y "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\lib%ARCH_BITS%\sicutu%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icutu%POSTFIX_D%.lib"
204+
copy /y "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\lib%ARCH_BITS%\sicuuc%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuuc%POSTFIX_D%.lib"
205+
copy /y "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\lib%ARCH_BITS%\sicudt%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icudt%POSTFIX_D%.lib"
206+
copy /y "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\lib%ARCH_BITS%\sicuin%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuin%POSTFIX_D%.lib"
207+
copy /y "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\lib%ARCH_BITS%\sicuio%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icuio%POSTFIX_D%.lib"
208+
REM NOTE not available in 58.2 at least, nor needed by us.
209+
REM copy /y "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\lib%ARCH_BITS%\sicule%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\icule%POSTFIX_D%.lib"
210+
REM copy /y "%DEPS_DIR%\icu-%ICU_VER%-vs%VS_VER%\lib%ARCH_BITS%\siculx%POSTFIX_D%.lib" "%INSTALL_DIR%\icu\lib\iculx%POSTFIX_D%.lib"
209211
)
210212

211213
:OpenCOLLADA
@@ -473,7 +475,7 @@ if not exist "%~2". (
473475
popd
474476
exit /b %RET%
475477

476-
:: GitCloneAndCheckoutRevision - Clones a Git repository and checks out a specific revision
478+
:: GitCloneAndCheckoutRevision - Clones a Git repository and checks out a specific revision or tag
477479
:: Params: %1 gitUrl, %2 destDir, %3 revision
478480
:: F.ex. call :GitCloneAndCheckoutRevision https://github.com/KhronosGroup/OpenCOLLADA.git "%DEPENDENCY_DIR%" 064a60b65c2c31b94f013820856bc84fb1937cc6
479481
:GitCloneAndCheckoutRevision
@@ -489,6 +491,7 @@ if not exist "%~2". (
489491
set RET=0
490492
)
491493
pushd "%2"
494+
call git fetch
492495
call cecho.cmd 0 13 "Checking out %DEPENDENCY_NAME% revision %3."
493496
call git checkout %3
494497
set RET=%ERRORLEVEL%

win/vs-cfg.cmd

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ set GENERATORS[6]="Visual Studio 12 2013 Win64"
4343
set GENERATORS[7]="Visual Studio 12 2013"
4444
set GENERATORS[8]="Visual Studio 14 2015 Win64"
4545
set GENERATORS[9]="Visual Studio 14 2015"
46-
set LAST_GENERATOR_IDX=9
46+
:: NOTE VC version for VS 2017 is not 15 but 14.1: have to wait and see
47+
:: if CMake generator string is updated to reflect this.
48+
set GENERATORS[10]="Visual Studio 15 2017 Win64"
49+
set GENERATORS[11]="Visual Studio 15 2017"
50+
set LAST_GENERATOR_IDX=11
4751

4852
set STEP=2
4953
:: Is generator shorthand used?
@@ -67,7 +71,8 @@ echo(!GENERATOR! | findstr /c:"vs20" >nul && (
6771

6872
:: Deduce desired architecture from the location of cl.exe
6973
:: TODO harmless "INFO: Could not find files for the given pattern(s)." spam if cl.exe not in path
70-
where cl.exe | findstr /c:"amd64" >nul
74+
:: Look for path with either "amd64" or "x64" (VS 2017 and newer)
75+
where cl.exe | findstr "amd64 x64" >nul
7176
set START=%ERRORLEVEL%
7277

7378
IF "!GENERATOR!"=="" IF NOT "%VisualStudioVersion%"=="" (
@@ -108,7 +113,7 @@ set TARGET_ARCH=x86
108113
:: Visual Studio platform name, Win32 (i.e. x86) or x64.
109114
set VS_PLATFORM=Win32
110115

111-
:: Find out VS version, VC versions and are we doing 64-bit or not.
116+
:: Find out VS (e.g. 2015) and VC (e.g. 14) versions and are we targeting x64 or not (x86).
112117
:: VS_VER and VC_VER are convenience variables used f.ex. for filenames.
113118
set GENERATOR_NO_DOUBLEQUOTES=%GENERATOR:"=%
114119
set GENERATOR_SPLIT=%GENERATOR_NO_DOUBLEQUOTES: =,%

0 commit comments

Comments
 (0)