From 5685774a7da321a07cb5cf40279b111237064370 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 29 Jan 2022 15:57:12 +0800 Subject: [PATCH] Print out quick start autoconfiguration summary, simplify configuration --- tool/quick_start/common_config.py | 4 ++++ tool/quick_start/config_default.json | 28 +++++++++++++--------------- tool/quick_start/find_max.py | 2 ++ tool/quick_start/find_toolchain.py | 17 ++++++----------- tool/quick_start/find_vstudio.py | 2 +- tool/quick_start/print_summary.py | 22 ++++++++++++++++++++++ tool/quick_start/test.bat | 2 ++ 7 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 tool/quick_start/find_max.py create mode 100644 tool/quick_start/print_summary.py diff --git a/tool/quick_start/common_config.py b/tool/quick_start/common_config.py index 7bbb91adf..25f3fa789 100644 --- a/tool/quick_start/common_config.py +++ b/tool/quick_start/common_config.py @@ -15,10 +15,14 @@ if not "Win64" in NeLUserConfig["Paths"]: NeLUserConfig["Paths"]["Win64"] = {} if not "Toolchain" in NeLUserConfig: NeLUserConfig["Toolchain"] = {} +if not "Client" in NeLUserConfig["Toolchain"]: + NeLUserConfig["Toolchain"]["Client"] = {} NeLConfig["Paths"]["Win64"].update(NeLUserConfig["Paths"]["Win64"]) NeLUserConfig["Paths"]["Win64"] = NeLConfig["Paths"]["Win64"] NeLConfig["Paths"].update(NeLUserConfig["Paths"]) NeLUserConfig["Paths"] = NeLConfig["Paths"] +NeLConfig["Toolchain"]["Client"].update(NeLUserConfig["Toolchain"]["Client"]) +NeLUserConfig["Toolchain"]["Client"] = NeLConfig["Toolchain"]["Client"] NeLConfig["Toolchain"].update(NeLUserConfig["Toolchain"]) NeLUserConfig["Toolchain"] = NeLConfig["Toolchain"] NeLConfig.update(NeLUserConfig) diff --git a/tool/quick_start/config_default.json b/tool/quick_start/config_default.json index cc4404b4b..56f97dc66 100644 --- a/tool/quick_start/config_default.json +++ b/tool/quick_start/config_default.json @@ -30,22 +30,20 @@ ], "Server": [{ "OS": "Ubuntu20", "Hunter": false }], "Client": { - "exedll_32": "Win32", - "exedll_64": "Win64" + "exedll_32": [ + { "OS": "Win98", "Platform": "x86", "Hunter": false }, + { "OS": "Win2k", "Platform": "x86", "Hunter": false }, + { "OS": "WinXP", "Platform": "x86", "Hunter": false }, + { "OS": "Win7", "Platform": "x86", "Hunter": false }, + { "OS": "WinXP", "Platform": "x86" }, + { "OS": "Win7", "Platform": "x86" } + ], + "exedll_64": [ + { "OS": "WinXP", "Platform": "x64", "Hunter": false }, + { "OS": "Win7", "Platform": "x64", "Hunter": false }, + { "OS": "Win7", "Platform": "x64" } + ] }, - "Win32": [ - { "OS": "Win98", "Platform": "x86", "Hunter": false }, - { "OS": "Win2k", "Platform": "x86", "Hunter": false }, - { "OS": "WinXP", "Platform": "x86", "Hunter": false }, - { "OS": "Win7", "Platform": "x86", "Hunter": false }, - { "OS": "WinXP", "Platform": "x86" }, - { "OS": "Win7", "Platform": "x86" } - ], - "Win64": [ - { "OS": "WinXP", "Platform": "x64", "Hunter": false }, - { "OS": "Win7", "Platform": "x64", "Hunter": false }, - { "OS": "Win7", "Platform": "x64" } - ], "Options": [ { "Filter": { "Compiler": "MSVC" }, diff --git a/tool/quick_start/find_max.py b/tool/quick_start/find_max.py new file mode 100644 index 000000000..631ccf78e --- /dev/null +++ b/tool/quick_start/find_max.py @@ -0,0 +1,2 @@ + +# Script finds latest max installation, user directory, and max SDKs diff --git a/tool/quick_start/find_toolchain.py b/tool/quick_start/find_toolchain.py index e6c311356..11beb8f86 100644 --- a/tool/quick_start/find_toolchain.py +++ b/tool/quick_start/find_toolchain.py @@ -9,7 +9,7 @@ def FindToolchain(filter): ts = NeLToolchains[tsn] okay = True for k in filter: - if not ((not k in ts and not filter[k]) or ts[k] == filter[k]): + if not ((not k in ts and not filter[k]) or (k in ts and ts[k] == filter[k])): okay = False break if okay: @@ -33,15 +33,10 @@ def FindToolchainEx(filters): return res return -NeLToolchainWin32 = FindToolchainEx(NeLConfig["Toolchain"]["Win32"]) -NeLToolchainWin64 = FindToolchainEx(NeLConfig["Toolchain"]["Win64"]) -NeLToolchainServer = FindToolchainEx(NeLConfig["Toolchain"]["Server"]) - -print("Win32:") -print(NeLToolchainWin32) -print("Win64:") -print(NeLToolchainWin64) -print("Server:") -print(NeLToolchainServer) +NeLToolchainNative = [ + { "Native": True }, # G++ on Linux + { "OS": "Win7", "Platform": "x64", "Hunter": False }, # Fallback, VS on Windows + { "OS": "Win7", "Platform": "x64" } +] # end of file diff --git a/tool/quick_start/find_vstudio.py b/tool/quick_start/find_vstudio.py index 270264d02..b314ae074 100644 --- a/tool/quick_start/find_vstudio.py +++ b/tool/quick_start/find_vstudio.py @@ -123,7 +123,7 @@ for vs in list(FoundVisualStudio): # C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v150\Platforms\Win32\PlatformToolsets\v141_xp checkPath = os.path.join(vs["Path"], "MSBuild\\Microsoft\\VC\\" + platform + "\\Platforms\\Win32\\PlatformToolsets\\" + vs["Toolset"] + "_xp") if os.path.isdir(checkPath): - FoundVisualStudio += [ { "Name": vs["Name"], "DisplayName": vs["DisplayName"] + " (Windows XP Support)", "Path": vs["Path"], "Version": vs["Version"], "Toolset": vs["Toolset"] + "_xp", "HasMFC": vs["HasMFC"] } ] + FoundVisualStudio += [ { "Name": vs["Name"], "DisplayName": vs["DisplayName"], "Path": vs["Path"], "Version": vs["Version"], "Toolset": vs["Toolset"] + "_xp", "HasMFC": vs["HasMFC"] } ] def FindVCVars32(path): auxVars = os.path.join(path, "VC\\Auxiliary\\Build\\vcvars32.bat") diff --git a/tool/quick_start/print_summary.py b/tool/quick_start/print_summary.py new file mode 100644 index 000000000..a81a477aa --- /dev/null +++ b/tool/quick_start/print_summary.py @@ -0,0 +1,22 @@ + +from find_toolchain import * + +def printBuildTarget(name, filters): + tn = FindToolchainEx(filters) + if tn: + tc = NeLToolchains[tn] + print(" " + name + ": " + tc["DisplayName"] + " (" + tc["Generator"] + ", " + tc["Toolset"] + ", " + tc["Platform"] + ")") + else: + print(" " + name + ": NOT FOUND") + +print("Build targets:") +printBuildTarget("client_dev", NeLToolchainNative) +printBuildTarget("server_dev", NeLToolchainNative) +for client in NeLConfig["Toolchain"]["Client"]: + printBuildTarget(client, NeLConfig["Toolchain"]["Client"][client]) +printBuildTarget("server", NeLConfig["Toolchain"]["Server"]) +printBuildTarget("tools", NeLToolchainNative) +printBuildTarget("samples", NeLToolchainNative) +# plugin_max + +# end of file \ No newline at end of file diff --git a/tool/quick_start/test.bat b/tool/quick_start/test.bat index 9ad55e2b4..9f20a6908 100644 --- a/tool/quick_start/test.bat +++ b/tool/quick_start/test.bat @@ -1,2 +1,4 @@ ..\..\..\external\python27\python.exe configure_toolchains.py ..\..\..\external\python27\python.exe find_toolchain.py +..\..\..\external\python27\python.exe find_max.py +..\..\..\external\python27\python.exe print_summary.py