|
@@ -1060,6 +1060,10 @@ def CompileCxx(obj,src,opts):
|
|
|
cmd += "/DWINVER=0x601 "
|
|
cmd += "/DWINVER=0x601 "
|
|
|
else:
|
|
else:
|
|
|
cmd += "/DWINVER=0x501 "
|
|
cmd += "/DWINVER=0x501 "
|
|
|
|
|
+ # Work around a WinXP/2003 bug when using VS 2015+.
|
|
|
|
|
+ if SDK.get("VISUALSTUDIO_VERSION") == '14.0':
|
|
|
|
|
+ cmd += "/Zc:threadSafeInit- "
|
|
|
|
|
+
|
|
|
cmd += "/Fo" + obj + " /nologo /c"
|
|
cmd += "/Fo" + obj + " /nologo /c"
|
|
|
if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
|
|
if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
|
|
|
cmd += " /arch:SSE2"
|
|
cmd += " /arch:SSE2"
|
|
@@ -2884,22 +2888,72 @@ if tp_dir is not None:
|
|
|
|
|
|
|
|
if GetTarget() == 'windows':
|
|
if GetTarget() == 'windows':
|
|
|
CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
|
|
CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
|
|
|
- if not PkgSkip("PYTHON"):
|
|
|
|
|
- pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
|
|
|
|
|
- if (GetOptimize() <= 2): pydll += "_d.dll"
|
|
|
|
|
- else: pydll += ".dll"
|
|
|
|
|
- CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
|
|
|
|
|
-
|
|
|
|
|
- for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
|
|
|
|
|
- CopyFile(GetOutputDir() + "/bin/", fn)
|
|
|
|
|
-
|
|
|
|
|
- if not RTDIST:
|
|
|
|
|
- CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
|
|
|
|
|
- if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
|
|
|
|
|
- CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
|
|
|
|
|
- if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
|
|
|
|
|
- CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
|
|
|
|
|
- ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if not PkgSkip("PYTHON") and not RTDIST:
|
|
|
|
|
+ #XXX rdb I don't think we need to copy over the Python DLL, do we?
|
|
|
|
|
+ #pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
|
|
|
|
|
+ #if (GetOptimize() <= 2): pydll += "_d.dll"
|
|
|
|
|
+ #else: pydll += ".dll"
|
|
|
|
|
+ #CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
|
|
|
|
|
+
|
|
|
|
|
+ #for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
|
|
|
|
|
+ # CopyFile(GetOutputDir() + "/bin/", fn)
|
|
|
|
|
+
|
|
|
|
|
+ # Copy the whole Python directory.
|
|
|
|
|
+ CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
|
|
|
|
|
+
|
|
|
|
|
+ # NB: Python does not always ship with the correct manifest/dll.
|
|
|
|
|
+ # Figure out the correct one to ship, and grab it from WinSxS dir.
|
|
|
|
|
+ manifest = GetOutputDir() + '/tmp/python.manifest'
|
|
|
|
|
+ if os.path.isfile(manifest):
|
|
|
|
|
+ os.unlink(manifest)
|
|
|
|
|
+ oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
|
|
|
|
|
+
|
|
|
|
|
+ if os.path.isfile(manifest):
|
|
|
|
|
+ import xml.etree.ElementTree as ET
|
|
|
|
|
+ tree = ET.parse(manifest)
|
|
|
|
|
+ idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
|
|
|
|
|
+ else:
|
|
|
|
|
+ idents = ()
|
|
|
|
|
+
|
|
|
|
|
+ for ident in tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity'):
|
|
|
|
|
+ sxs_name = '_'.join([
|
|
|
|
|
+ ident.get('processorArchitecture'),
|
|
|
|
|
+ ident.get('name').lower(),
|
|
|
|
|
+ ident.get('publicKeyToken'),
|
|
|
|
|
+ ident.get('version'),
|
|
|
|
|
+ ])
|
|
|
|
|
+
|
|
|
|
|
+ # Find the manifest matching these parameters.
|
|
|
|
|
+ pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
|
|
|
|
|
+ manifests = glob.glob(pattern)
|
|
|
|
|
+ if not manifests:
|
|
|
|
|
+ print("%sWARNING:%s Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (GetColor("red"), GetColor(), pattern))
|
|
|
|
|
+ continue
|
|
|
|
|
+
|
|
|
|
|
+ CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
|
|
|
|
|
+
|
|
|
|
|
+ # Also copy the corresponding msvcr dll.
|
|
|
|
|
+ pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
|
|
|
|
|
+ for file in glob.glob(pattern):
|
|
|
|
|
+ CopyFile(GetOutputDir() + "/python/", file)
|
|
|
|
|
+
|
|
|
|
|
+ # Copy python.exe to ppython.exe.
|
|
|
|
|
+ if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
|
|
|
|
|
+ CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
|
|
|
|
|
+ if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
|
|
|
|
|
+ CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
|
|
|
|
|
+ ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
|
|
|
|
|
+
|
|
|
|
|
+# Copy over the MSVC runtime.
|
|
|
|
|
+if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
|
|
|
|
|
+ vcver = SDK["VISUALSTUDIO_VERSION"].replace('.', '')
|
|
|
|
|
+ crtname = "Microsoft.VC%s.CRT" % (vcver)
|
|
|
|
|
+ dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
|
|
|
|
|
+
|
|
|
|
|
+ if os.path.isdir(dir):
|
|
|
|
|
+ CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
|
|
|
|
|
+ CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
|
|
|
|
|
|
|
|
########################################################################
|
|
########################################################################
|
|
|
##
|
|
##
|