Use Python 3 for the quick start scripts

feature/quick-start-py
kaetemi 3 years ago
parent ceb10c3d21
commit 730d174f39
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -1,5 +1,5 @@
from common_config import * from . common_config import *
import os import os

@ -1,5 +1,5 @@
from common_root import * from .common_root import *
import os, json, socket import os, json, socket

@ -0,0 +1,5 @@
# This generates the build scripts for all targets
# end of file

@ -1,9 +1,12 @@
# This script generates a configuration file listing all the available toolchains # This script generates a configuration file listing all the available toolchains
from common import * import sys, os
from find_vstudio import * sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from find_external import *
from quick_start.common import *
from quick_start.find_vstudio import *
from quick_start.find_external import *
Toolchains = {} Toolchains = {}
@ -36,8 +39,26 @@ for ts in SortedToolsets:
if not len(toolchain["Prefix"]) and vs["Version"] >= 14: if not len(toolchain["Prefix"]) and vs["Version"] >= 14:
toolchain["Hunter"] = True toolchain["Hunter"] = True
toolchain["CMake"] = [] toolchain["CMake"] = []
if vs["Version"] < 14: # Set the SDK version
toolchain["CMake"] += [ "-DWINSDK_VERSION=6.0A" ] # https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
# C:\Program Files (x86)\Windows Kits\10
if vs["Version"] < 14 and not ts.endswith("_xp"):
if vs["Version"] >= 12: # 2013
toolchain["CMake"] += [ "-DWINSDK_VERSION=8.1A" ]
elif vs["Version"] >= 11: # 2012
toolchain["CMake"] += [ "-DWINSDK_VERSION=8.0A" ]
elif vs["Version"] >= 10: # 2010
toolchain["CMake"] += [ "-DWINSDK_VERSION=7.0A" ]
elif vs["Version"] >= 9:
# C:\Program Files\Microsoft SDKs\Windows\v6.0A
if os.path.isfile("C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Include\\Msi.h"):
toolchain["CMake"] += [ "-DWINSDK_DIR=C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A" ]
toolchain["CMake"] += [ "-DWINSDK_VERSION=6.0A" ]
else:
# C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
if os.path.isfile("C:\\Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Include\\Msi.h"):
toolchain["CMake"] += [ "-DWINSDK_DIR=C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2" ]
toolchain["CMake"] += [ "-DWINSDK_VERSION=5.2" ]
toolchain["EnvPath"] = FindBinPaths(toolchain["Prefix"]) toolchain["EnvPath"] = FindBinPaths(toolchain["Prefix"])
toolchain["EnvSet"] = [] toolchain["EnvSet"] = []
# For XP support, simply target SDK 7.1A # For XP support, simply target SDK 7.1A
@ -97,6 +118,8 @@ for ts in SortedToolsets:
copyToolchain["Prefix"] = [] copyToolchain["Prefix"] = []
copyToolchain["EnvPath"] = [] copyToolchain["EnvPath"] = []
copyToolchain["EnvSet"] += [ "CL=/DLIBXML_STATIC;%CL%" ] copyToolchain["EnvSet"] += [ "CL=/DLIBXML_STATIC;%CL%" ]
if "LuaVersion" in copyToolchain:
del copyToolchain["LuaVersion"]
Toolchains[toolchain["OS"] + "/VS/" + ts + "/" + platform + "/H"] = copyToolchain Toolchains[toolchain["OS"] + "/VS/" + ts + "/" + platform + "/H"] = copyToolchain
with open(os.path.join(NeLConfigDir, "toolchains_" + socket.gethostname().lower() + "_default.json"), 'w') as fo: with open(os.path.join(NeLConfigDir, "toolchains_" + socket.gethostname().lower() + "_default.json"), 'w') as fo:

@ -2,7 +2,7 @@
# This script detects all external library paths # This script detects all external library paths
# Useful for locating all dynamic libraries # Useful for locating all dynamic libraries
from common_config import * from .common_config import *
import os import os

@ -2,12 +2,13 @@
# Script finds latest max installation, user directory, and max SDKs # Script finds latest max installation, user directory, and max SDKs
import os import os
from itertools import chain
def HasPluginMax(path): def HasPluginMax(path):
return os.path.isfile(os.path.join(path, "3dsmax.exe")) and (os.path.isfile(os.path.join(path, "plugins/nelexport_r.dlu")) or os.path.isfile(os.path.join(path, "plugins/nelexport_d.dlu")) or os.path.isfile(os.path.join(path, "plugins/nelexport.dlu"))) return os.path.isfile(os.path.join(path, "3dsmax.exe")) and (os.path.isfile(os.path.join(path, "plugins/nelexport_r.dlu")) or os.path.isfile(os.path.join(path, "plugins/nelexport_d.dlu")) or os.path.isfile(os.path.join(path, "plugins/nelexport.dlu")))
def FindPluginMax(): def FindPluginMax():
for i in range(2038, 2007, -1) + range(9, 2, -1): for i in chain(range(2038, 2007, -1), range(9, 2, -1)):
path = os.getenv('ADSK_3DSMAX_x64_' + str(i)) path = os.getenv('ADSK_3DSMAX_x64_' + str(i))
if path and HasPluginMax(path): if path and HasPluginMax(path):
return os.path.normpath(path) return os.path.normpath(path)
@ -19,7 +20,7 @@ def FindPluginMax():
return os.path.normpath(path) return os.path.normpath(path)
def FindLatestMax(): def FindLatestMax():
for i in range(2038, 2007, -1) + range(9, 2, -1): for i in chain(range(2038, 2007, -1), range(9, 2, -1)):
path = os.getenv('ADSK_3DSMAX_x64_' + str(i)) path = os.getenv('ADSK_3DSMAX_x64_' + str(i))
if path and os.path.isfile(os.path.join(path, "3dsmax.exe")): if path and os.path.isfile(os.path.join(path, "3dsmax.exe")):
return os.path.normpath(path) return os.path.normpath(path)
@ -101,7 +102,7 @@ def FindMaxSDKs():
res = [] res = []
set = {} set = {}
remap = {} remap = {}
for i in range(3, 10) + range(2008, 2039): for i in chain(range(3, 10), range(2008, 2039)):
found = FindMaxSDK(i) found = FindMaxSDK(i)
if found: if found:
set[i] = True set[i] = True

@ -0,0 +1,33 @@
from .find_toolchain import *
from .find_max import *
NeLTargetClientDev = FindToolchainEx(NeLToolchainNative)
NeLTargetServerDev = FindToolchainEx(NeLToolchainNative)
NeLTargetClient = {}
for client in NeLConfig["Toolchain"]["Client"]:
NeLTargetClient[client] = FindToolchainEx(NeLConfig["Toolchain"]["Client"][client])
NeLTargetServer = FindToolchainEx(NeLConfig["Toolchain"]["Server"])
NeLTargetTools = FindToolchainEx(NeLToolchainNative)
NeLTargetSamples = FindToolchainEx(NeLToolchainNative)
NelTargetPluginMax = {}
remapMaxCompatible = {}
foundMax = {}
for maxSdk in FoundMaxSDKs:
if "Compatible" in maxSdk:
# Skip unnecessary builds
if maxSdk["Compatible"] in foundMax:
continue
filters = [ { "Toolset": maxSdk["Toolset"], "Platform": maxSdk["Platform"], "HasMFC": True, "Hunter": True }, { "Toolset": maxSdk["Toolset"], "Platform": maxSdk["Platform"], "HasMFC": True } ]
foundTs = FindToolchainEx(filters)
if foundTs:
foundMax[maxSdk["Version"]] = True
if "Compatible" in maxSdk:
foundMax[maxSdk["Compatible"]] = True
NelTargetPluginMax[str(maxSdk["Version"]) + "_" + maxSdk["Platform"]] = foundTs
del filters
del foundTs
del remapMaxCompatible
del foundMax
# end of file

@ -1,7 +1,7 @@
# This script finds the best toolchains for each purpose # This script finds the best toolchains for each purpose
from common import * from .common import *
def FindToolchain(filter): def FindToolchain(filter):
toolchains = {} toolchains = {}

@ -1,9 +1,10 @@
from find_toolchain import * import sys, os
from find_max import * sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
def printBuildTarget(name, filters): from quick_start.find_targets import *
tn = FindToolchainEx(filters)
def printBuildTarget(name, tn):
if tn: if tn:
tc = NeLToolchains[tn] tc = NeLToolchains[tn]
withHunter = "" withHunter = ""
@ -14,26 +15,14 @@ def printBuildTarget(name, filters):
print(" " + name + ": NOT FOUND") print(" " + name + ": NOT FOUND")
print("Build targets:") print("Build targets:")
printBuildTarget("client_dev", NeLToolchainNative) printBuildTarget("client_dev", NeLTargetClientDev)
printBuildTarget("server_dev", NeLToolchainNative) printBuildTarget("server_dev", NeLTargetServerDev)
for client in NeLConfig["Toolchain"]["Client"]: for client in NeLTargetClient:
printBuildTarget(client, NeLConfig["Toolchain"]["Client"][client]) printBuildTarget(client, NeLTargetClient[client])
printBuildTarget("server", NeLConfig["Toolchain"]["Server"]) printBuildTarget("server", NeLTargetServer)
printBuildTarget("tools", NeLToolchainNative) printBuildTarget("tools", NeLTargetTools)
printBuildTarget("samples", NeLToolchainNative) printBuildTarget("samples", NeLTargetSamples)
remapMaxCompatible = {} for pluginMax in NelTargetPluginMax:
foundMax = {} printBuildTarget("plugin_max/" + pluginMax, NelTargetPluginMax[pluginMax])
for maxSdk in FoundMaxSDKs:
if "Compatible" in maxSdk:
# Skip unnecessary builds
if maxSdk["Compatible"] in foundMax:
continue
filters = [ { "Toolset": maxSdk["Toolset"], "Platform": maxSdk["Platform"], "HasMFC": True, "Hunter": True }, { "Toolset": maxSdk["Toolset"], "Platform": maxSdk["Platform"], "HasMFC": True } ]
if FindToolchainEx(filters):
foundMax[maxSdk["Version"]] = True
if "Compatible" in maxSdk:
foundMax[maxSdk["Compatible"]] = True
printBuildTarget("plugin_max/" + str(maxSdk["Version"]) + "_" + maxSdk["Platform"], filters)
# plugin_max
# end of file # end of file

@ -1,4 +1,4 @@
..\..\..\external\python27\python.exe configure_toolchains.py rem ..\..\..\external\python3\python.exe configure_toolchains.py
..\..\..\external\python27\python.exe find_toolchain.py rem ..\..\..\external\python3\python.exe find_toolchain.py
..\..\..\external\python27\python.exe find_max.py rem ..\..\..\external\python3\python.exe find_max.py
..\..\..\external\python27\python.exe print_summary.py ..\..\..\external\python3\python.exe print_summary.py

Loading…
Cancel
Save