0003-add-uwp-v142-and-v143-support.patch 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. diff --git a/build/make/configure.sh b/build/make/configure.sh
  2. index 119d206..41bac75 100644
  3. --- a/build/make/configure.sh
  4. +++ b/build/make/configure.sh
  5. @@ -1038,7 +1038,7 @@ EOF
  6. # A number of ARM-based Windows platforms are constrained by their
  7. # respective SDKs' limitations. Fortunately, these are all 32-bit ABIs
  8. # and so can be selected as 'win32'.
  9. - if [ ${tgt_os} = "win32" ]; then
  10. + if [ ${tgt_os} = "win32" ] || [ ${tgt_isa} = "armv7" ]; then
  11. asm_conversion_cmd="${source_path_mk}/build/make/ads2armasm_ms.pl"
  12. AS_SFX=.S
  13. msvs_arch_dir=arm-msvs
  14. @@ -1272,6 +1272,9 @@ EOF
  15. android)
  16. soft_enable realtime_only
  17. ;;
  18. + uwp)
  19. + enabled gcc && add_cflags -fno-common
  20. + ;;
  21. win*)
  22. enabled gcc && add_cflags -fno-common
  23. ;;
  24. @@ -1390,6 +1393,16 @@ EOF
  25. fi
  26. AS_SFX=.asm
  27. case ${tgt_os} in
  28. + uwp)
  29. + if [ {$tgt_isa} = "x86" ] || [ {$tgt_isa} = "armv7" ]; then
  30. + add_asflags -f win32
  31. + else
  32. + add_asflags -f win64
  33. + fi
  34. + enabled debug && [ "${AS}" = yasm ] && add_asflags -g cv8
  35. + enabled debug && [ "${AS}" = nasm ] && add_asflags -gcv8
  36. + EXE_SFX=.exe
  37. + ;;
  38. win32)
  39. add_asflags -f win32
  40. enabled debug && [ "${AS}" = yasm ] && add_asflags -g cv8
  41. @@ -1519,6 +1532,8 @@ EOF
  42. # Almost every platform uses pthreads.
  43. if enabled multithread; then
  44. case ${toolchain} in
  45. + *-uwp-vs*)
  46. + ;;
  47. *-win*-vs*)
  48. ;;
  49. *-android-gcc)
  50. diff --git a/build/make/gen_msvs_vcxproj.sh b/build/make/gen_msvs_vcxproj.sh
  51. index 58bb66b..b4cad6c 100644
  52. --- a/build/make/gen_msvs_vcxproj.sh
  53. +++ b/build/make/gen_msvs_vcxproj.sh
  54. @@ -296,7 +296,22 @@ generate_vcxproj() {
  55. tag_content ProjectGuid "{${guid}}"
  56. tag_content RootNamespace ${name}
  57. tag_content Keyword ManagedCProj
  58. - if [ $vs_ver -ge 12 ] && [ "${platforms[0]}" = "ARM" ]; then
  59. + if [ $vs_ver -ge 16 ]; then
  60. + if [[ $target =~ [^-]*-uwp-.* ]]; then
  61. + # Universal Windows Applications
  62. + tag_content AppContainerApplication true
  63. + tag_content ApplicationType "Windows Store"
  64. + tag_content ApplicationTypeRevision 10.0
  65. + fi
  66. + if [[ $target =~ [^-]*-uwp-.* ]] || [ "${platforms[0]}" = "ARM" ] || [ "${platforms[0]}" = "ARM64" ]; then
  67. + # Default to the latest Windows 10 SDK
  68. + tag_content WindowsTargetPlatformVersion 10.0
  69. + else
  70. + # Minimum supported version of Windows for the desktop
  71. + tag_content WindowsTargetPlatformVersion 8.1
  72. + fi
  73. + tag_content MinimumVisualStudioVersion 16.0
  74. + elif [ $vs_ver -ge 12 ] && [ "${platforms[0]}" = "ARM" ]; then
  75. tag_content AppContainerApplication true
  76. # The application type can be one of "Windows Store",
  77. # "Windows Phone" or "Windows Phone Silverlight". The
  78. @@ -394,7 +409,7 @@ generate_vcxproj() {
  79. Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'"
  80. if [ "$name" == "vpx" ]; then
  81. hostplat=$plat
  82. - if [ "$hostplat" == "ARM" ]; then
  83. + if [ "$hostplat" == "ARM" ] && [ $vs_ver -le 15 ]; then
  84. hostplat=Win32
  85. fi
  86. fi
  87. diff --git a/configure b/configure
  88. index beea650..91ae3c8 100644
  89. --- a/configure
  90. +++ b/configure
  91. @@ -102,16 +102,24 @@ all_platforms="${all_platforms} arm64-darwin-gcc"
  92. all_platforms="${all_platforms} arm64-darwin20-gcc"
  93. all_platforms="${all_platforms} arm64-darwin21-gcc"
  94. all_platforms="${all_platforms} arm64-linux-gcc"
  95. +all_platforms="${all_platforms} arm64-uwp-vs16"
  96. +all_platforms="${all_platforms} arm64-uwp-vs17"
  97. all_platforms="${all_platforms} arm64-win64-gcc"
  98. all_platforms="${all_platforms} arm64-win64-vs15"
  99. +all_platforms="${all_platforms} arm64-win64-vs16"
  100. +all_platforms="${all_platforms} arm64-win64-vs17"
  101. all_platforms="${all_platforms} armv7-android-gcc" #neon Cortex-A8
  102. all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8
  103. all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8
  104. all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8
  105. all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8
  106. +all_platforms="${all_platforms} armv7-uwp-vs16"
  107. +all_platforms="${all_platforms} armv7-uwp-vs17"
  108. all_platforms="${all_platforms} armv7-win32-gcc"
  109. all_platforms="${all_platforms} armv7-win32-vs14"
  110. all_platforms="${all_platforms} armv7-win32-vs15"
  111. +all_platforms="${all_platforms} armv7-win32-vs16"
  112. +all_platforms="${all_platforms} armv7-win32-vs17"
  113. all_platforms="${all_platforms} armv7s-darwin-gcc"
  114. all_platforms="${all_platforms} armv8-linux-gcc"
  115. all_platforms="${all_platforms} loongarch32-linux-gcc"
  116. @@ -138,6 +146,8 @@ all_platforms="${all_platforms} x86-linux-gcc"
  117. all_platforms="${all_platforms} x86-linux-icc"
  118. all_platforms="${all_platforms} x86-os2-gcc"
  119. all_platforms="${all_platforms} x86-solaris-gcc"
  120. +all_platforms="${all_platforms} x86-uwp-vs16"
  121. +all_platforms="${all_platforms} x86-uwp-vs17"
  122. all_platforms="${all_platforms} x86-win32-gcc"
  123. all_platforms="${all_platforms} x86-win32-vs14"
  124. all_platforms="${all_platforms} x86-win32-vs15"
  125. @@ -161,6 +171,8 @@ all_platforms="${all_platforms} x86_64-iphonesimulator-gcc"
  126. all_platforms="${all_platforms} x86_64-linux-gcc"
  127. all_platforms="${all_platforms} x86_64-linux-icc"
  128. all_platforms="${all_platforms} x86_64-solaris-gcc"
  129. +all_platforms="${all_platforms} x86_64-uwp-vs16"
  130. +all_platforms="${all_platforms} x86_64-uwp-vs17"
  131. all_platforms="${all_platforms} x86_64-win64-gcc"
  132. all_platforms="${all_platforms} x86_64-win64-vs14"
  133. all_platforms="${all_platforms} x86_64-win64-vs15"
  134. @@ -485,11 +497,10 @@ process_targets() {
  135. ! enabled multithread && DIST_DIR="${DIST_DIR}-nomt"
  136. ! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs"
  137. DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}"
  138. - case "${tgt_os}" in
  139. - win*) enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_DIR}md"
  140. - DIST_DIR="${DIST_DIR}-${tgt_cc}"
  141. - ;;
  142. - esac
  143. + if [[ ${tgt_os} =~ win.* ]] || [ "${tgt_os}" = "uwp" ]; then
  144. + enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_DIR}md"
  145. + DIST_DIR="${DIST_DIR}-${tgt_cc}"
  146. + fi
  147. if [ -f "${source_path}/build/make/version.sh" ]; then
  148. ver=`"$source_path/build/make/version.sh" --bare "$source_path"`
  149. DIST_DIR="${DIST_DIR}-${ver}"
  150. @@ -578,6 +589,10 @@ process_detect() {
  151. # Specialize windows and POSIX environments.
  152. case $toolchain in
  153. + *-uwp-*)
  154. + # Don't check for any headers in UWP builds.
  155. + false
  156. + ;;
  157. *-win*-*)
  158. # Don't check for any headers in Windows builds.
  159. false