prepare_solution_win.bat 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. @ECHO OFF
  2. REM
  3. REM Copyright (c) Contributors to the Open 3D Engine Project.
  4. REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. REM
  6. REM SPDX-License-Identifier: Apache-2.0 OR MIT
  7. REM
  8. set platform=win
  9. set architecture=x64
  10. set generator="Visual Studio 16 2019"
  11. set curr_dir=%~dp0
  12. set src_path=%curr_dir%\src
  13. set build_path=%curr_dir%\build\%platform%_%architecture%
  14. set cmake_exe=cmake
  15. REM boost-regex is required on windows only because docopt needs a better std::regex implementation
  16. REM than then one provided by visual studio.
  17. REM ----------------------------------
  18. REM Pulling boost from git
  19. 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
  20. REM Compiling boost-regex multithreaded dynamic libraries
  21. cd src\external\boost
  22. CALL .\bootstrap.bat
  23. .\b2 threading=multi link=static,shared runtime-link=shared address-model=64 -j64 --with-regex || goto :error
  24. cd ..\..\..\
  25. REM ----------------------------------
  26. REM Pulling ANTLR from git
  27. python pull_from_git.py --git-url https://github.com/galibzon/antlr4.git --destination-dir src/external --git-tag o3de-4.7.1 || goto :error
  28. if not exist "%build_path%" mkdir "%build_path%"
  29. cd "%build_path%" || goto :error
  30. REM ----------------------------------
  31. REM Generate ANTLR runtime project
  32. if not exist external mkdir external
  33. cd external
  34. if not exist antlr4 mkdir antlr4
  35. cd antlr4
  36. if not exist runtime mkdir runtime
  37. cd runtime
  38. if not exist Cpp mkdir Cpp
  39. cd Cpp
  40. %cmake_exe% -G %generator% "%src_path%\external\antlr4\runtime\Cpp\" || goto :error
  41. 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
  42. copy /Y "runtime\antlr4_static2.vcxproj" "runtime\antlr4_static.vcxproj"
  43. REM ----------------------------------
  44. REM Generate AZSLc project
  45. cd "%build_path%"
  46. %cmake_exe% -G %generator% "%src_path%" || goto :error
  47. if [%1] == [] pause
  48. goto :EOF
  49. :error
  50. @echo Failed to prepare solution :(
  51. cd "%curr_dir%"
  52. if [%1] == [] pause
  53. exit /b 1