Browse Source

makepanda: MSVC fix generating non-SSE2 code for x86

Closes #1018
Fixes #1017
kamgha 5 years ago
parent
commit
30d8c90f77
1 changed files with 6 additions and 2 deletions
  1. 6 2
      makepanda/makepanda.py

+ 6 - 2
makepanda/makepanda.py

@@ -1313,8 +1313,12 @@ def CompileCxx(obj,src,opts):
                 cmd += "/Zc:threadSafeInit- "
                 cmd += "/Zc:threadSafeInit- "
 
 
             cmd += "/Fo" + obj + " /nologo /c"
             cmd += "/Fo" + obj + " /nologo /c"
-            if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
-                cmd += " /arch:SSE2"
+            if GetTargetArch() == 'x86':
+                # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
+                if not PkgSkip("SSE2") or 'SSE2' in opts:   # x86 with SSE2
+                    cmd += " /arch:SSE2"    # let's still be explicit and pass in /arch:SSE2
+                else:                                       # x86 without SSE2
+                    cmd += " /arch:IA32"
             for x in ipath: cmd += " /I" + x
             for x in ipath: cmd += " /I" + x
             for (opt,dir) in INCDIRECTORIES:
             for (opt,dir) in INCDIRECTORIES:
                 if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
                 if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)