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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. diff --git a/build/make/configure.sh b/build/make/configure.sh
  2. index 110f16e..c161d0e 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 b212e07..1a9fa98 100755
  89. --- a/configure
  90. +++ b/configure
  91. @@ -104,6 +104,8 @@ all_platforms="${all_platforms} arm64-darwin21-gcc"
  92. all_platforms="${all_platforms} arm64-darwin22-gcc"
  93. all_platforms="${all_platforms} arm64-darwin23-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. @@ -115,6 +117,8 @@ all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8
  101. all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8
  102. all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8
  103. all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8
  104. +all_platforms="${all_platforms} armv7-uwp-vs16"
  105. +all_platforms="${all_platforms} armv7-uwp-vs17"
  106. all_platforms="${all_platforms} armv7-win32-gcc"
  107. all_platforms="${all_platforms} armv7-win32-vs14"
  108. all_platforms="${all_platforms} armv7-win32-vs15"
  109. @@ -146,6 +150,8 @@ all_platforms="${all_platforms} x86-linux-gcc"
  110. all_platforms="${all_platforms} x86-linux-icc"
  111. all_platforms="${all_platforms} x86-os2-gcc"
  112. all_platforms="${all_platforms} x86-solaris-gcc"
  113. +all_platforms="${all_platforms} x86-uwp-vs16"
  114. +all_platforms="${all_platforms} x86-uwp-vs17"
  115. all_platforms="${all_platforms} x86-win32-gcc"
  116. all_platforms="${all_platforms} x86-win32-vs14"
  117. all_platforms="${all_platforms} x86-win32-vs15"
  118. @@ -171,6 +177,8 @@ all_platforms="${all_platforms} x86_64-iphonesimulator-gcc"
  119. all_platforms="${all_platforms} x86_64-linux-gcc"
  120. all_platforms="${all_platforms} x86_64-linux-icc"
  121. all_platforms="${all_platforms} x86_64-solaris-gcc"
  122. +all_platforms="${all_platforms} x86_64-uwp-vs16"
  123. +all_platforms="${all_platforms} x86_64-uwp-vs17"
  124. all_platforms="${all_platforms} x86_64-win64-gcc"
  125. all_platforms="${all_platforms} x86_64-win64-vs14"
  126. all_platforms="${all_platforms} x86_64-win64-vs15"
  127. @@ -503,11 +511,10 @@ process_targets() {
  128. ! enabled multithread && DIST_DIR="${DIST_DIR}-nomt"
  129. ! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs"
  130. DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}"
  131. - case "${tgt_os}" in
  132. - win*) enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_DIR}md"
  133. - DIST_DIR="${DIST_DIR}-${tgt_cc}"
  134. - ;;
  135. - esac
  136. + if [[ ${tgt_os} =~ win.* ]] || [ "${tgt_os}" = "uwp" ]; then
  137. + enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_DIR}md"
  138. + DIST_DIR="${DIST_DIR}-${tgt_cc}"
  139. + fi
  140. if [ -f "${source_path}/build/make/version.sh" ]; then
  141. ver=`"$source_path/build/make/version.sh" --bare "$source_path"`
  142. DIST_DIR="${DIST_DIR}-${ver}"
  143. @@ -596,6 +603,10 @@ process_detect() {
  144. # Specialize windows and POSIX environments.
  145. case $toolchain in
  146. + *-uwp-*)
  147. + # Don't check for any headers in UWP builds.
  148. + false
  149. + ;;
  150. *-win*-*)
  151. # Don't check for any headers in Windows builds.
  152. false