The static CRT (libcmt.lib, as used by default or with -MT) doesn't
work when targeting these API subsets.

Only do this if no cflags for CRT selection have been specified,
to allow users to override this default if the user knows better.
---
 configure | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/configure b/configure
index 77eb8f5..541d6ce 100755
--- a/configure
+++ b/configure
@@ -3460,6 +3460,29 @@ if [ "$cpu" != generic ]; then
     add_asflags $cpuflags
 fi
 
+# Set the right default MSVC CRT if necessary
+if enabled_any msvc icl && check_cpp_condition stdlib.h 
"defined(WINAPI_FAMILY)"; then
+    if check_cpp <<EOF
+#include <winapifamily.h>
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#error desktop
+#endif
+EOF
+    then
+        for flag in $CFLAGS; do
+            case $flag in
+            -M[TD]*)
+                crtflag=$flag
+                ;;
+            esac
+        done
+        # If targeting the app/phone subsets, add -MD by default if no -MD/-MT 
flags have been specified
+        if [ -z "$crtflag" ]; then
+            add_cflags -MD
+        fi
+    fi
+fi
+
 # compiler sanity check
 check_exec <<EOF
 int main(void){ return 0; }
-- 
1.8.1.2

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to