setup_arguments.cmd 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. @echo off
  2. set MPT_VS_VER=%1
  3. set MPT_VS_TARGET=%2
  4. set MPT_VS_ARCH=%3
  5. set MPT_VS_CONF=%4
  6. set MPT_PKG_FORMAT=%5
  7. set MPT_VS_FLAVOUR=%6
  8. if "%MPT_VS_VER%" == "" goto setupargumentserror
  9. if "%MPT_VS_TARGET%" == "" goto setupargumentserror
  10. if "%MPT_VS_ARCH%" == "" goto setupargumentserror
  11. if "%MPT_VS_CONF%" == "" goto setupargumentserror
  12. if "%MPT_PKG_FORMAT%" == "" goto setupargumentserror
  13. goto setupargumentsstart
  14. :setupargumentserror
  15. echo "Usage: foo.cmd vs2019 xp Win32 Release 7z default"
  16. rem vs2019 winxp Win32 Release x86-32 winxp release static
  17. rem MPT_VS_VER MPT_VS_TARGET MPT_VS_ARCH MPT_VS_CONF MPT_BIN_ARCH MPT_BIN_TARGET MPT_BIN_CONF MPT_BIN_RUNTIME
  18. exit 1
  19. :setupargumentsstart
  20. if "%MPT_VS_TARGET%" == "winxp" set MPT_VS_WITHTARGET=%MPT_VS_VER%winxp
  21. if "%MPT_VS_TARGET%" == "vista" set MPT_VS_WITHTARGET=%MPT_VS_VER%winvista
  22. if "%MPT_VS_TARGET%" == "win7" set MPT_VS_WITHTARGET=%MPT_VS_VER%win7
  23. if "%MPT_VS_TARGET%" == "win81" set MPT_VS_WITHTARGET=%MPT_VS_VER%win81
  24. if "%MPT_VS_TARGET%" == "win10" set MPT_VS_WITHTARGET=%MPT_VS_VER%win10
  25. if "%MPT_VS_TARGET%" == "default" set MPT_VS_WITHTARGET=%MPT_VS_VER%win81
  26. if "%MPT_VS_TARGET%" == "win10clang" set MPT_VS_WITHTARGET=%MPT_VS_VER%win10clang
  27. if "%MPT_VS_ARCH%" == "Win32" (
  28. if "%MPT_VS_TARGET%" == "winxp" set MPT_BIN_TARGET=winxp
  29. if "%MPT_VS_TARGET%" == "vista" set MPT_BIN_TARGET=vista
  30. if "%MPT_VS_TARGET%" == "win7" set MPT_BIN_TARGET=win7
  31. if "%MPT_VS_TARGET%" == "win81" set MPT_BIN_TARGET=win81
  32. if "%MPT_VS_TARGET%" == "win10" set MPT_BIN_TARGET=win10
  33. if "%MPT_VS_TARGET%" == "default" set MPT_BIN_TARGET=win81
  34. if "%MPT_VS_TARGET%" == "win10clang" set MPT_BIN_TARGET=win10clang
  35. )
  36. if "%MPT_VS_ARCH%" == "x64" (
  37. if "%MPT_VS_TARGET%" == "winxp" set MPT_BIN_TARGET=winxp
  38. if "%MPT_VS_TARGET%" == "vista" set MPT_BIN_TARGET=vista
  39. if "%MPT_VS_TARGET%" == "win7" set MPT_BIN_TARGET=win7
  40. if "%MPT_VS_TARGET%" == "win81" set MPT_BIN_TARGET=win81
  41. if "%MPT_VS_TARGET%" == "win10" set MPT_BIN_TARGET=win10
  42. if "%MPT_VS_TARGET%" == "default" set MPT_BIN_TARGET=win81
  43. if "%MPT_VS_TARGET%" == "win10clang" set MPT_BIN_TARGET=win10clang
  44. )
  45. if "%MPT_VS_ARCH%" == "ARM" (
  46. if "%MPT_VS_TARGET%" == "winxp" set MPT_BIN_TARGET=winxp
  47. if "%MPT_VS_TARGET%" == "vista" set MPT_BIN_TARGET=vista
  48. if "%MPT_VS_TARGET%" == "win7" set MPT_BIN_TARGET=win7
  49. if "%MPT_VS_TARGET%" == "win81" set MPT_BIN_TARGET=win81
  50. if "%MPT_VS_TARGET%" == "win10" set MPT_BIN_TARGET=win10
  51. if "%MPT_VS_TARGET%" == "default" set MPT_BIN_TARGET=win81
  52. if "%MPT_VS_TARGET%" == "win10clang" set MPT_BIN_TARGET=win10clang
  53. )
  54. if "%MPT_VS_ARCH%" == "ARM64" (
  55. if "%MPT_VS_TARGET%" == "winxp" set MPT_BIN_TARGET=winxp
  56. if "%MPT_VS_TARGET%" == "vista" set MPT_BIN_TARGET=vista
  57. if "%MPT_VS_TARGET%" == "win7" set MPT_BIN_TARGET=win7
  58. if "%MPT_VS_TARGET%" == "win81" set MPT_BIN_TARGET=win81
  59. if "%MPT_VS_TARGET%" == "win10" set MPT_BIN_TARGET=win10
  60. if "%MPT_VS_TARGET%" == "default" set MPT_BIN_TARGET=win81
  61. if "%MPT_VS_TARGET%" == "win10clang" set MPT_BIN_TARGET=win10clang
  62. )
  63. if "%MPT_VS_TARGET%" == "winxp" set MPT_BIN_TARGET32=winxp
  64. if "%MPT_VS_TARGET%" == "vista" set MPT_BIN_TARGET32=vista
  65. if "%MPT_VS_TARGET%" == "win7" set MPT_BIN_TARGET32=win7
  66. if "%MPT_VS_TARGET%" == "win81" set MPT_BIN_TARGET32=win81
  67. if "%MPT_VS_TARGET%" == "win10" set MPT_BIN_TARGET32=win10
  68. if "%MPT_VS_TARGET%" == "default" set MPT_BIN_TARGET32=win81
  69. if "%MPT_VS_TARGET%" == "win10clang" set MPT_BIN_TARGET32=win10clang
  70. if "%MPT_VS_TARGET%" == "winxp" set MPT_BIN_TARGET64=winxp
  71. if "%MPT_VS_TARGET%" == "vista" set MPT_BIN_TARGET64=vista
  72. if "%MPT_VS_TARGET%" == "win7" set MPT_BIN_TARGET64=win7
  73. if "%MPT_VS_TARGET%" == "win81" set MPT_BIN_TARGET64=win81
  74. if "%MPT_VS_TARGET%" == "win10" set MPT_BIN_TARGET64=win10
  75. if "%MPT_VS_TARGET%" == "default" set MPT_BIN_TARGET64=win81
  76. if "%MPT_VS_TARGET%" == "win10clang" set MPT_BIN_TARGET64=win10clang
  77. if "%MPT_VS_ARCH%" == "Win32" set MPT_BIN_ARCH_TRK=x86
  78. if "%MPT_VS_ARCH%" == "x64" set MPT_BIN_ARCH_TRK=amd64
  79. if "%MPT_VS_ARCH%" == "ARM" set MPT_BIN_ARCH_TRK=arm
  80. if "%MPT_VS_ARCH%" == "ARM64" set MPT_BIN_ARCH_TRK=arm64
  81. if "%MPT_VS_ARCH%" == "Win32" set MPT_BIN_ARCH=x86
  82. if "%MPT_VS_ARCH%" == "x64" set MPT_BIN_ARCH=amd64
  83. if "%MPT_VS_ARCH%" == "ARM" set MPT_BIN_ARCH=arm
  84. if "%MPT_VS_ARCH%" == "ARM64" set MPT_BIN_ARCH=arm64
  85. if "%MPT_VS_CONF%" == "Release" set MPT_BIN_CONF=release
  86. if "%MPT_VS_CONF%" == "ReleaseShared" set MPT_BIN_CONF=release
  87. if "%MPT_VS_CONF%" == "Release" set MPT_BIN_RUNTIME=static
  88. if "%MPT_VS_CONF%" == "ReleaseShared" set MPT_BIN_RUNTIME=shared
  89. if "%MPT_VS_ARCH%" == "Win32" set MPT_DIST_VARIANT_ARCH=x86
  90. if "%MPT_VS_ARCH%" == "x64" set MPT_DIST_VARIANT_ARCH=amd64
  91. if "%MPT_VS_ARCH%" == "ARM" set MPT_DIST_VARIANT_ARCH=arm
  92. if "%MPT_VS_ARCH%" == "ARM64" set MPT_DIST_VARIANT_ARCH=arm64
  93. if "%MPT_VS_TARGET%" == "winxp" set MPT_DIST_VARIANT_OS=winxp
  94. if "%MPT_VS_TARGET%" == "vista" set MPT_DIST_VARIANT_OS=winvista
  95. if "%MPT_VS_TARGET%" == "win7" set MPT_DIST_VARIANT_OS=win7
  96. if "%MPT_VS_TARGET%" == "win81" set MPT_DIST_VARIANT_OS=win81
  97. if "%MPT_VS_TARGET%" == "win10" set MPT_DIST_VARIANT_OS=win10
  98. if "%MPT_VS_TARGET%" == "default" set MPT_DIST_VARIANT_OS=win81
  99. if "%MPT_VS_TARGET%" == "win10clang" set MPT_DIST_VARIANT_OS=win10clang
  100. set MPT_DIST_VARIANT=%MPT_DIST_VARIANT_OS%-%MPT_DIST_VARIANT_ARCH%
  101. if "%MPT_VS_TARGET%" == "winxp" set MPT_DIST_VARIANT_PREFIX=retro-winxp
  102. if "%MPT_VS_TARGET%" == "vista" set MPT_DIST_VARIANT_PREFIX=retro-winvista
  103. if "%MPT_VS_TARGET%" == "win7" set MPT_DIST_VARIANT_PREFIX=win7
  104. if "%MPT_VS_TARGET%" == "win81" set MPT_DIST_VARIANT_PREFIX=win81
  105. if "%MPT_VS_TARGET%" == "win10" set MPT_DIST_VARIANT_PREFIX=win10
  106. if "%MPT_VS_TARGET%" == "default" set MPT_DIST_VARIANT_PREFIX=
  107. if "%MPT_VS_TARGET%" == "win10clang" set MPT_DIST_VARIANT_PREFIX=win10clang
  108. if "%MPT_VS_ARCH%" == "Win32" set MPT_DIST_VARIANT_SUFFIX=x86
  109. if "%MPT_VS_ARCH%" == "x64" set MPT_DIST_VARIANT_SUFFIX=amd64
  110. if "%MPT_VS_ARCH%" == "ARM" set MPT_DIST_VARIANT_SUFFIX=arm
  111. if "%MPT_VS_ARCH%" == "ARM64" set MPT_DIST_VARIANT_SUFFIX=arm64
  112. set MPT_DIST_VARIANT_TRK=%MPT_DIST_VARIANT_PREFIX%-%MPT_DIST_VARIANT_SUFFIX%
  113. rem Environment Variable \ Program Bitness 32bit Native 64bit Native WOW64
  114. rem PROCESSOR_ARCHITECTURE x86 AMD64 x86
  115. rem PROCESSOR_ARCHITEW6432 undefined undefined AMD64
  116. set MPT_HOST_BITNESS=32
  117. if "%PROCESSOR_ARCHITECTURE%" == "x86" (
  118. if "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
  119. set MPT_HOST_BITNESS=64
  120. ) else (
  121. set MPT_HOST_BITNESS=32
  122. )
  123. )
  124. if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
  125. set MPT_HOST_BITNESS=64
  126. )
  127. if "%MPT_PKG_FORMAT%" == "" set MPT_PKG_FORMAT=zip
  128. if "%MPT_PKG_FORMAT%" == "7z" set MPT_PKG_FORMAT_SYMBOLS=xz
  129. if "%MPT_PKG_FORMAT%" == "zip" set MPT_PKG_FORMAT_SYMBOLS=zip
  130. if "%MPT_PKG_FORMAT_SYMBOLS%" == "" set MPT_PKG_FORMAT_SYMBOLS=zip
  131. if "%MPT_VS_FLAVOUR%" == "default" set MPT_VS_FLAVOUR=