forked from o3de/o3de-azslc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_solution_win.bat
66 lines (53 loc) · 2.14 KB
/
prepare_solution_win.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@ECHO OFF
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
set platform=win
set architecture=x64
set generator="Visual Studio 16 2019"
set curr_dir=%~dp0
set src_path=%curr_dir%\src
set build_path=%curr_dir%\build\%platform%_%architecture%
set cmake_exe=cmake
REM boost-regex is required on windows only because docopt needs a better std::regex implementation
REM than then one provided by visual studio.
REM ----------------------------------
REM Pulling boost from git
python pull_from_git.py --git-url https://github.com/boostorg/boost.git --destination-dir src/external --git-tag boost-1.70.0 || goto :error
REM Compiling boost-regex multithreaded dynamic libraries
cd src\external\boost
CALL .\bootstrap.bat
.\b2 threading=multi link=static,shared runtime-link=shared address-model=64 -j64 --with-regex || goto :error
cd ..\..\..\
REM ----------------------------------
REM Pulling ANTLR from git
python pull_from_git.py --git-url https://github.com/o3de/antlr4.git --destination-dir src/external --git-tag o3de-4.7.1 || goto :error
if not exist "%build_path%" mkdir "%build_path%"
cd "%build_path%" || goto :error
REM ----------------------------------
REM Generate ANTLR runtime project
if not exist external mkdir external
cd external
if not exist antlr4 mkdir antlr4
cd antlr4
if not exist runtime mkdir runtime
cd runtime
if not exist Cpp mkdir Cpp
cd Cpp
%cmake_exe% -G %generator% "%src_path%\external\antlr4\runtime\Cpp\" || goto :error
python -c "import sys; sys.stdout.write( open(sys.argv[1], 'r', encoding='utf-8_sig').read().replace('</RuntimeLibrary>', 'DLL</RuntimeLibrary>'))" runtime\antlr4_static.vcxproj > runtime\antlr4_static2.vcxproj || goto :error
copy /Y "runtime\antlr4_static2.vcxproj" "runtime\antlr4_static.vcxproj"
REM ----------------------------------
REM Generate AZSLc project
cd "%build_path%"
%cmake_exe% -G %generator% "%src_path%" || goto :error
if [%1] == [] pause
goto :EOF
:error
@echo Failed to prepare solution :(
cd "%curr_dir%"
if [%1] == [] pause
exit /b 1