mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
further fixes for cross-compiling on windows
This commit is contained in:
parent
930848539c
commit
f251e29237
@ -1264,18 +1264,18 @@ def CompileLib(lib, obj, opts):
|
|||||||
if (COMPILER=="MSVC"):
|
if (COMPILER=="MSVC"):
|
||||||
if not BOOUSEINTELCOMPILER:
|
if not BOOUSEINTELCOMPILER:
|
||||||
#Use MSVC Linker
|
#Use MSVC Linker
|
||||||
cmd = 'link /lib /nologo '
|
cmd = 'link /lib /nologo'
|
||||||
if GetTargetArch() == 'x64':
|
if HasTargetArch():
|
||||||
cmd += "/MACHINE:X64 "
|
cmd += " /MACHINE:" + GetTargetArch().upper()
|
||||||
cmd += '/OUT:' + BracketNameWithQuotes(lib)
|
cmd += ' /OUT:' + BracketNameWithQuotes(lib)
|
||||||
for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
|
for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
|
||||||
oscmd(cmd)
|
oscmd(cmd)
|
||||||
else:
|
else:
|
||||||
# Choose Intel linker; from Jean-Claude
|
# Choose Intel linker; from Jean-Claude
|
||||||
cmd = 'xilink /verbose:lib /lib '
|
cmd = 'xilink /verbose:lib /lib '
|
||||||
if GetTargetArch() == 'x64':
|
if HasTargetArch():
|
||||||
cmd += "/MACHINE:X64 "
|
cmd += " /MACHINE:" + GetTargetArch().upper()
|
||||||
cmd += '/OUT:' + BracketNameWithQuotes(lib)
|
cmd += ' /OUT:' + BracketNameWithQuotes(lib)
|
||||||
for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
|
for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
|
||||||
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
|
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
|
||||||
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
|
cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
|
||||||
@ -1303,8 +1303,8 @@ def CompileLink(dll, obj, opts):
|
|||||||
if (COMPILER=="MSVC"):
|
if (COMPILER=="MSVC"):
|
||||||
if not BOOUSEINTELCOMPILER:
|
if not BOOUSEINTELCOMPILER:
|
||||||
cmd = "link /nologo "
|
cmd = "link /nologo "
|
||||||
if GetTargetArch() == 'x64':
|
if HasTargetArch():
|
||||||
cmd += " /MACHINE:X64"
|
cmd += " /MACHINE:" + GetTargetArch().upper()
|
||||||
if ("MFC" not in opts):
|
if ("MFC" not in opts):
|
||||||
cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
|
cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
|
||||||
cmd += " /NOD:LIBCI.LIB /DEBUG"
|
cmd += " /NOD:LIBCI.LIB /DEBUG"
|
||||||
@ -1347,8 +1347,8 @@ def CompileLink(dll, obj, opts):
|
|||||||
else:
|
else:
|
||||||
cmd = "xilink"
|
cmd = "xilink"
|
||||||
if GetVerbose(): cmd += " /verbose:lib"
|
if GetVerbose(): cmd += " /verbose:lib"
|
||||||
if GetTargetArch() == 'x64':
|
if HasTargetArch():
|
||||||
cmd += " /MACHINE:X64"
|
cmd += " /MACHINE:" + GetTargetArch().upper()
|
||||||
if ("MFC" not in opts):
|
if ("MFC" not in opts):
|
||||||
cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
|
cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
|
||||||
cmd += " /NOD:LIBCI.LIB /DEBUG"
|
cmd += " /NOD:LIBCI.LIB /DEBUG"
|
||||||
@ -1579,7 +1579,7 @@ def RunGenPyCode(target, inputs, opts):
|
|||||||
if (PkgSkip("PYTHON") != 0):
|
if (PkgSkip("PYTHON") != 0):
|
||||||
return
|
return
|
||||||
|
|
||||||
cmdstr = SDK["PYTHONEXEC"] + " " + os.path.join("direct", "src", "ffi", "jGenPyCode.py")
|
cmdstr = sys.executable + " -B " + os.path.join("direct", "src", "ffi", "jGenPyCode.py")
|
||||||
if (GENMAN): cmdstr += " -d"
|
if (GENMAN): cmdstr += " -d"
|
||||||
cmdstr += " -r"
|
cmdstr += " -r"
|
||||||
for i in inputs:
|
for i in inputs:
|
||||||
@ -1597,7 +1597,7 @@ def RunGenPyCode(target, inputs, opts):
|
|||||||
def FreezePy(target, inputs, opts):
|
def FreezePy(target, inputs, opts):
|
||||||
assert len(inputs) > 0
|
assert len(inputs) > 0
|
||||||
# Make sure this function isn't called before genpycode is run.
|
# Make sure this function isn't called before genpycode is run.
|
||||||
cmdstr = SDK["PYTHONEXEC"] + " " + os.path.join("direct", "src", "showutil", "pfreeze.py")
|
cmdstr = sys.executable + " -B " + os.path.join("direct", "src", "showutil", "pfreeze.py")
|
||||||
src = inputs.pop(0)
|
src = inputs.pop(0)
|
||||||
for i in inputs:
|
for i in inputs:
|
||||||
cmdstr += " -i " + os.path.splitext(i)[0]
|
cmdstr += " -i " + os.path.splitext(i)[0]
|
||||||
@ -1621,10 +1621,10 @@ def FreezePy(target, inputs, opts):
|
|||||||
def Package(target, inputs, opts):
|
def Package(target, inputs, opts):
|
||||||
assert len(inputs) == 1
|
assert len(inputs) == 1
|
||||||
# Invoke the ppackage script.
|
# Invoke the ppackage script.
|
||||||
command = SDK["PYTHONEXEC"]
|
command = sys.executable
|
||||||
if (GetOptimizeOption(opts) >= 4):
|
if (GetOptimizeOption(opts) >= 4):
|
||||||
command += " -OO"
|
command += " -OO"
|
||||||
command += " direct/src/p3d/ppackage.py"
|
command += " -B direct/src/p3d/ppackage.py"
|
||||||
|
|
||||||
if GetTarget() == "darwin":
|
if GetTarget() == "darwin":
|
||||||
if SDK.get("MACOSX") is not None:
|
if SDK.get("MACOSX") is not None:
|
||||||
@ -5853,7 +5853,7 @@ def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
|
|||||||
# Invoke the make_installer script.
|
# Invoke the make_installer script.
|
||||||
AddToPathEnv("PATH", GetOutputDir() + "\\bin")
|
AddToPathEnv("PATH", GetOutputDir() + "\\bin")
|
||||||
AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
|
AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
|
||||||
oscmd(SDK["PYTHONEXEC"] + " direct\\src\\plugin_installer\\make_installer.py --version %s" % VERSION)
|
oscmd(sys.executable + " -B direct\\src\\plugin_installer\\make_installer.py --version %s" % VERSION)
|
||||||
shutil.move("direct\\src\\plugin_installer\\p3d-setup.exe", file)
|
shutil.move("direct\\src\\plugin_installer\\p3d-setup.exe", file)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -6155,7 +6155,7 @@ def MakeInstallerOSX():
|
|||||||
if (RUNTIME):
|
if (RUNTIME):
|
||||||
# Invoke the make_installer script.
|
# Invoke the make_installer script.
|
||||||
AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
|
AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
|
||||||
oscmd(SDK["PYTHONEXEC"] + " direct/src/plugin_installer/make_installer.py --version %s" % VERSION)
|
oscmd(sys.executable + " -B direct/src/plugin_installer/make_installer.py --version %s" % VERSION)
|
||||||
return
|
return
|
||||||
|
|
||||||
import compileall
|
import compileall
|
||||||
|
@ -2033,20 +2033,25 @@ def SetupVisualStudioEnviron():
|
|||||||
exit("Could not find the Microsoft Platform SDK")
|
exit("Could not find the Microsoft Platform SDK")
|
||||||
os.environ["VCINSTALLDIR"] = SDK["VISUALSTUDIO"] + "VC"
|
os.environ["VCINSTALLDIR"] = SDK["VISUALSTUDIO"] + "VC"
|
||||||
os.environ["WindowsSdkDir"] = SDK["MSPLATFORM"]
|
os.environ["WindowsSdkDir"] = SDK["MSPLATFORM"]
|
||||||
suffix=""
|
target_suffix = ""
|
||||||
arch = GetTargetArch()
|
host_suffix = ""
|
||||||
if (arch == 'x64'): suffix = "\\amd64"
|
target_arch = GetTargetArch()
|
||||||
AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "VC\\bin"+suffix)
|
if (target_arch == 'x64'):
|
||||||
|
target_suffix = "\\amd64"
|
||||||
|
if (GetHostArch() == 'x64'):
|
||||||
|
host_suffix = "\\amd64"
|
||||||
|
|
||||||
|
AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "VC\\bin"+host_suffix)
|
||||||
AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "Common7\\IDE")
|
AddToPathEnv("PATH", SDK["VISUALSTUDIO"] + "Common7\\IDE")
|
||||||
AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\include")
|
AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\include")
|
||||||
AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\include")
|
AddToPathEnv("INCLUDE", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\include")
|
||||||
AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\lib"+suffix)
|
AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\lib"+target_suffix)
|
||||||
AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\lib"+suffix)
|
AddToPathEnv("LIB", SDK["VISUALSTUDIO"] + "VC\\atlmfc\\lib"+target_suffix)
|
||||||
AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin")
|
AddToPathEnv("PATH", SDK["MSPLATFORM"] + "bin")
|
||||||
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include")
|
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include")
|
||||||
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl")
|
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\atl")
|
||||||
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\mfc")
|
AddToPathEnv("INCLUDE", SDK["MSPLATFORM"] + "include\\mfc")
|
||||||
if (arch != 'x64'):
|
if (target_arch != 'x64'):
|
||||||
AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib")
|
AddToPathEnv("LIB", SDK["MSPLATFORM"] + "lib")
|
||||||
AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.CRT")
|
AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.CRT")
|
||||||
AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.MFC")
|
AddToPathEnv("PATH",SDK["VISUALSTUDIO"] + "VC\\redist\\x86\\Microsoft.VC100.MFC")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user