|
|
@@ -64,9 +64,10 @@ PLUGIN_VERSION=None
|
|
|
OSXTARGET=None
|
|
|
OSX_ARCHS=[]
|
|
|
HOST_URL=None
|
|
|
-global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER
|
|
|
+global STRDXSDKVERSION, BOOUSEINTELCOMPILER
|
|
|
STRDXSDKVERSION = 'default'
|
|
|
-STRMSPLATFORMVERSION = 'default'
|
|
|
+WINDOWS_SDK = None
|
|
|
+MSVC_VERSION = None
|
|
|
BOOUSEINTELCOMPILER = False
|
|
|
OPENCV_VER_23 = False
|
|
|
|
|
|
@@ -152,7 +153,8 @@ def usage(problem):
|
|
|
print(" --nothing (disable every third-party lib)")
|
|
|
print(" --everything (enable every third-party lib)")
|
|
|
print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
|
|
|
- print(" --platform-sdk=X (specify MSPlatSdk to use: win71, win61, win60A, winserver2003r2)")
|
|
|
+ print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
|
|
|
+ print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)")
|
|
|
print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
|
|
|
print("")
|
|
|
print("The simplest way to compile panda is to just type:")
|
|
|
@@ -165,13 +167,13 @@ def parseopts(args):
|
|
|
global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
|
|
|
global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
|
|
|
global DEBVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX
|
|
|
- global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER
|
|
|
+ global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
|
|
|
longopts = [
|
|
|
"help","distributor=","verbose","runtime","osxtarget=",
|
|
|
"optimize=","everything","nothing","installer","rtdist","nocolor",
|
|
|
"version=","lzma","no-python","threads=","outputdir=","override=",
|
|
|
"static","host=","debversion=","rpmrelease=","p3dsuffix=",
|
|
|
- "directx-sdk=", "platform-sdk=", "use-icl",
|
|
|
+ "directx-sdk=", "windows-sdk=", "msvc-version=", "use-icl",
|
|
|
"universal", "target=", "arch=", "git-commit="]
|
|
|
anything = 0
|
|
|
optimize = ""
|
|
|
@@ -222,11 +224,10 @@ def parseopts(args):
|
|
|
if STRDXSDKVERSION == '':
|
|
|
print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
|
|
|
STRDXSDKVERSION = 'default'
|
|
|
- elif (option=="--platform-sdk"):
|
|
|
- STRMSPLATFORMVERSION = value.strip().lower()
|
|
|
- if STRMSPLATFORMVERSION == '':
|
|
|
- print("No MS Platform SDK version specified. Using 'default' MS Platform SDK search")
|
|
|
- STRMSPLATFORMVERSION = 'default'
|
|
|
+ elif (option=="--windows-sdk"):
|
|
|
+ WINDOWS_SDK = value.strip().lower()
|
|
|
+ elif (option=="--msvc-version"):
|
|
|
+ MSVC_VERSION = value.strip().lower()
|
|
|
elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
|
|
|
else:
|
|
|
for pkg in PkgListGet():
|
|
|
@@ -302,17 +303,30 @@ def parseopts(args):
|
|
|
if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
|
|
|
usage("Invalid SHA-1 hash given for --git-commit option!")
|
|
|
|
|
|
- is_win7 = False
|
|
|
- if GetHost() == "windows":
|
|
|
- if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']):
|
|
|
- platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
|
|
|
-
|
|
|
- if sys.platform == "win32":
|
|
|
- # Note: not available in cygwin.
|
|
|
- winver = sys.getwindowsversion()
|
|
|
- if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1:
|
|
|
- is_win7 = True
|
|
|
- if RUNTIME or not is_win7:
|
|
|
+ if GetTarget() == 'windows':
|
|
|
+ if not MSVC_VERSION:
|
|
|
+ print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).")
|
|
|
+ MSVC_VERSION = 10
|
|
|
+
|
|
|
+ try:
|
|
|
+ MSVC_VERSION = int(MSVC_VERSION)
|
|
|
+ except:
|
|
|
+ usage("Invalid setting for --msvc-version")
|
|
|
+
|
|
|
+ if not WINDOWS_SDK:
|
|
|
+ print("No Windows SDK version specified. Defaulting to '7.1'.")
|
|
|
+ WINDOWS_SDK = '7.1'
|
|
|
+
|
|
|
+ is_win7 = False
|
|
|
+ if sys.platform == 'win32':
|
|
|
+ # Note: not available in cygwin.
|
|
|
+ winver = sys.getwindowsversion()
|
|
|
+ if winver[0] >= 6 and winver[1] >= 1:
|
|
|
+ is_win7 = True
|
|
|
+
|
|
|
+ if RUNTIME or not is_win7:
|
|
|
+ PkgDisable("TOUCHINPUT")
|
|
|
+ else:
|
|
|
PkgDisable("TOUCHINPUT")
|
|
|
|
|
|
parseopts(sys.argv[1:])
|
|
|
@@ -444,8 +458,8 @@ SdkLocateMaya()
|
|
|
SdkLocateMax()
|
|
|
SdkLocateMacOSX(OSXTARGET)
|
|
|
SdkLocatePython(RTDIST)
|
|
|
-SdkLocateVisualStudio()
|
|
|
-SdkLocateMSPlatform(STRMSPLATFORMVERSION)
|
|
|
+SdkLocateVisualStudio(MSVC_VERSION)
|
|
|
+SdkLocateWindows(WINDOWS_SDK)
|
|
|
SdkLocatePhysX()
|
|
|
SdkLocateSpeedTree()
|
|
|
SdkLocateAndroid()
|
|
|
@@ -1050,6 +1064,10 @@ def CompileCxx(obj,src,opts):
|
|
|
if GetTargetArch() == 'x64':
|
|
|
cmd += " /DWIN64_VC /DWIN64"
|
|
|
|
|
|
+ if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > 10:
|
|
|
+ # To preserve Windows XP compatibility.
|
|
|
+ cmd += " /D_USING_V110_SDK71_"
|
|
|
+
|
|
|
cmd += " /W3 " + BracketNameWithQuotes(src)
|
|
|
oscmd(cmd)
|
|
|
else:
|
|
|
@@ -1485,9 +1503,13 @@ def CompileLink(dll, obj, opts):
|
|
|
cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
|
|
|
cmd += ' /OUT:' + BracketNameWithQuotes(dll)
|
|
|
|
|
|
- subsystem = GetValueOption(opts, "SUBSYSTEM:")
|
|
|
- if subsystem:
|
|
|
- cmd += " /SUBSYSTEM:" + subsystem
|
|
|
+ # Set the subsystem. Specify that we want to target Windows XP.
|
|
|
+ subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
|
|
|
+ cmd += " /SUBSYSTEM:" + subsystem
|
|
|
+ if GetTargetArch() == 'x64':
|
|
|
+ cmd += ",5.02"
|
|
|
+ else:
|
|
|
+ cmd += ",5.01"
|
|
|
|
|
|
if dll.endswith(".dll"):
|
|
|
cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
|
|
|
@@ -5096,7 +5118,7 @@ if (RTDIST or RUNTIME):
|
|
|
TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
|
|
|
TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
|
|
|
TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
|
|
|
- OPTS=['OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
|
|
|
+ OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
|
|
|
if GetTarget() == 'darwin':
|
|
|
OPTS += ['OPT:2']
|
|
|
TargetAdd('p3dcert.exe', opts=OPTS)
|
|
|
@@ -5106,7 +5128,7 @@ if (RTDIST or RUNTIME):
|
|
|
TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
|
|
|
TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
|
|
|
TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
|
|
|
- OPTS=['OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
|
|
|
+ OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
|
|
|
if GetTarget() == "darwin":
|
|
|
OPTS += ['GL', 'OPT:2']
|
|
|
TargetAdd('p3dcert.exe', opts=OPTS)
|
|
|
@@ -5236,7 +5258,7 @@ if (RUNTIME):
|
|
|
TargetAdd('panda3dw.exe', input='libp3dtool.dll')
|
|
|
TargetAdd('panda3dw.exe', input='libp3pystub.lib')
|
|
|
TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
|
|
|
- TargetAdd('panda3dw.exe', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
|
|
|
+ TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
|
|
|
|
|
|
if (RTDIST):
|
|
|
OPTS=['BUILDING:P3D_PLUGIN', 'DIR:direct/src/plugin_standalone', 'DIR:direct/src/plugin', 'DIR:dtool/src/dtoolbase', 'DIR:dtool/src/dtoolutil', 'DIR:dtool/src/pystub', 'DIR:dtool/src/prc', 'DIR:dtool/src/dconfig', 'DIR:panda/src/express', 'DIR:panda/src/downloader', 'RUNTIME', 'P3DEMBED', 'OPENSSL', 'ZLIB']
|
|
|
@@ -5312,7 +5334,7 @@ if (RTDIST):
|
|
|
TargetAdd('p3dembedw.exe', input='plugin_common.obj')
|
|
|
TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
|
|
|
TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
|
|
|
- TargetAdd('p3dembedw.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
|
|
|
+ TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
|
|
|
|
|
|
#
|
|
|
# DIRECTORY: pandatool/src/pandatoolbase/
|
|
|
@@ -6041,7 +6063,7 @@ if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)
|
|
|
TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
|
|
|
TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
|
|
|
TargetAdd('pstats.exe', input='libp3pystub.lib')
|
|
|
- TargetAdd('pstats.exe', opts=['WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
|
|
|
+ TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
|
|
|
|
|
|
#
|
|
|
# DIRECTORY: pandatool/src/xfileprogs/
|