1
0

build_tools.cmd 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @echo off
  2. if not "x%1" == "xauto" (
  3. echo "WARNING: This script will unconditionally remove all files from the destination directories."
  4. pause
  5. )
  6. if "x%2" == "xnodownload" (
  7. set MPT_DOWNLOAD=no
  8. )
  9. if not "x%2" == "xnodownload" (
  10. set MPT_DOWNLOAD=yes
  11. )
  12. set MY_DIR=%CD%
  13. set BATCH_DIR=%~dp0
  14. cd %BATCH_DIR% || goto error
  15. cd .. || goto error
  16. goto main
  17. :main
  18. if exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
  19. call build\auto\setup_vs2019.cmd || goto error
  20. cd include\genie\build\vs2019 || goto error
  21. msbuild genie.sln /target:Build /property:Configuration=Release;Platform=Win32;WindowsTargetPlatformVersion=10.0 /maxcpucount /verbosity:minimal || goto error
  22. cd ..\..\..\.. || goto error
  23. goto geniedone
  24. )
  25. if exist "C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
  26. call build\auto\setup_vs2019.cmd || goto error
  27. cd include\genie\build\vs2019 || goto error
  28. msbuild genie.sln /target:Build /property:Configuration=Release;Platform=Win32;WindowsTargetPlatformVersion=10.0 /maxcpucount /verbosity:minimal || goto error
  29. cd ..\..\..\.. || goto error
  30. goto geniedone
  31. )
  32. if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
  33. call build\auto\setup_vs2017.cmd || goto error
  34. cd include\genie\build\vs2017 || goto error
  35. msbuild genie.sln /target:Build /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  36. cd ..\..\..\.. || goto error
  37. goto geniedone
  38. )
  39. if exist "C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
  40. call build\auto\setup_vs2017.cmd || goto error
  41. cd include\genie\build\vs2017 || goto error
  42. msbuild genie.sln /target:Build /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  43. cd ..\..\..\.. || goto error
  44. goto geniedone
  45. )
  46. :geniedone
  47. copy /y include\genie\OpenMPT.txt include\genie\OpenMPT-version.txt
  48. if exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
  49. call build\auto\setup_vs2019.cmd || goto error
  50. rem cd include\premake || goto error
  51. rem nmake -f Bootstrap.mak windows MSDEV=vs2019 || goto error
  52. rem bin\release\premake5 embed --bytecode || goto error
  53. rem bin\release\premake5 --to=build/vs2019 vs2019 --no-curl --no-zlib --no-luasocket || goto error
  54. rem cd ..\.. || goto error
  55. cd include\premake\build\vs2019 || goto error
  56. msbuild Premake5.sln /target:Clean /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  57. msbuild Premake5.sln /target:Build /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  58. cd ..\..\..\.. || goto error
  59. goto premakedone
  60. )
  61. if exist "C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" (
  62. call build\auto\setup_vs2019.cmd || goto error
  63. rem cd include\premake || goto error
  64. rem nmake -f Bootstrap.mak windows MSDEV=vs2019 || goto error
  65. rem bin\release\premake5 embed --bytecode || goto error
  66. rem bin\release\premake5 --to=build/vs2019 vs2019 --no-curl --no-zlib --no-luasocket || goto error
  67. rem cd ..\.. || goto error
  68. cd include\premake\build\vs2019 || goto error
  69. msbuild Premake5.sln /target:Clean /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  70. msbuild Premake5.sln /target:Build /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  71. cd ..\..\..\.. || goto error
  72. goto premakedone
  73. )
  74. if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
  75. call build\auto\setup_vs2017.cmd || goto error
  76. rem cd include\premake || goto error
  77. rem nmake -f Bootstrap.mak windows MSDEV=vs2017 || goto error
  78. rem bin\release\premake5 embed --bytecode || goto error
  79. rem bin\release\premake5 --to=build/vs2017 vs2017 --no-curl --no-zlib --no-luasocket || goto error
  80. rem cd ..\.. || goto error
  81. cd include\premake\build\vs2017 || goto error
  82. msbuild Premake5.sln /target:Clean /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  83. msbuild Premake5.sln /target:Build /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  84. cd ..\..\..\.. || goto error
  85. goto premakedone
  86. )
  87. if exist "C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
  88. call build\auto\setup_vs2017.cmd || goto error
  89. rem cd include\premake || goto error
  90. rem nmake -f Bootstrap.mak windows MSDEV=vs2017 || goto error
  91. rem bin\release\premake5 embed --bytecode || goto error
  92. rem bin\release\premake5 --to=build/vs2017 vs2017 --no-curl --no-zlib --no-luasocket || goto error
  93. rem cd ..\.. || goto error
  94. cd include\premake\build\vs2017 || goto error
  95. msbuild Premake5.sln /target:Clean /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  96. msbuild Premake5.sln /target:Build /property:Configuration=Release;Platform=Win32 /maxcpucount /verbosity:minimal || goto error
  97. cd ..\..\..\.. || goto error
  98. goto premakedone
  99. )
  100. goto error
  101. :premakedone
  102. copy /y include\premake\OpenMPT.txt include\premake\OpenMPT-version.txt
  103. goto ok
  104. :ok
  105. echo "All OK."
  106. if "x%1" == "xauto" (
  107. exit 0
  108. )
  109. goto end
  110. :error
  111. echo "Error!"
  112. if "x%1" == "xauto" (
  113. exit 1
  114. )
  115. goto end
  116. :end
  117. cd %MY_DIR%
  118. pause