Generate toolchain configuration base
parent
a41156c708
commit
44b53fd0a5
@ -0,0 +1 @@
|
||||
Scripts to auto-configure the build pipeline for every possible build target that can be built from the local machine
|
@ -0,0 +1,38 @@
|
||||
|
||||
from common_config import *
|
||||
|
||||
import os
|
||||
|
||||
NeLCodeDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Code"])
|
||||
if not os.path.isdir(NeLCodeDir):
|
||||
exit("NeL Code directory (" + NeLCodeDir + ") does not exist.")
|
||||
NeLLeveldesignDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Leveldesign"])
|
||||
if not os.path.isdir(NeLLeveldesignDir):
|
||||
exit("NeL Leveldesign directory (" + NeLLeveldesignDir + ") does not exist.")
|
||||
NeLGraphicsDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Graphics"])
|
||||
if not os.path.isdir(NeLGraphicsDir):
|
||||
exit("NeL Graphics directory (" + NeLGraphicsDir + ") does not exist.")
|
||||
NeLSoundDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Sound"])
|
||||
if not os.path.isdir(NeLSoundDir):
|
||||
exit("NeL Sound directory (" + NeLSoundDir + ") does not exist.")
|
||||
NeLBuildDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Build"])
|
||||
if not os.path.isdir(NeLBuildDir):
|
||||
exit("NeL Build directory (" + NeLBuildDir + ") does not exist.")
|
||||
NeLPipelineDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Pipeline"])
|
||||
if not os.path.isdir(NeLPipelineDir):
|
||||
exit("NeL Pipeline directory (" + NeLPipelineDir + ") does not exist.")
|
||||
|
||||
NeLPython27Dir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["Python27"])
|
||||
NeLRRDtoolDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["RRDtool"])
|
||||
NeLMariaDBDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["MariaDB"])
|
||||
NeLNginxDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["Nginx"])
|
||||
NeLPHPDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["PHP"])
|
||||
NeLphpMyAdminDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["phpMyAdmin"])
|
||||
NeL3dsMaxDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["3dsMax"])
|
||||
|
||||
#print(NeLRootDir)
|
||||
#print(NeLConfigDir)
|
||||
#print(NeLConfig["Domain"])
|
||||
#print(NeLConfig["Paths"]["Code"])
|
||||
|
||||
#print(NeLExternalDir)
|
@ -0,0 +1,34 @@
|
||||
|
||||
# This script generates a configuration file listing all the available toolchains
|
||||
|
||||
from common import *
|
||||
from find_vstudio import *
|
||||
from find_external import *
|
||||
|
||||
Toolchains = {}
|
||||
|
||||
|
||||
# Only include one VS version per toolset
|
||||
ByToolset = {}
|
||||
SortedToolsets = []
|
||||
for vs in FoundVisualStudio:
|
||||
if not vs["Toolset"] in ByToolset:
|
||||
SortedToolsets += [ vs["Toolset"] ]
|
||||
if not vs["Toolset"] in ByToolset or ByToolset[vs["Toolset"]]["Version"] < vs["Version"]:
|
||||
ByToolset[vs["Toolset"]] = vs;
|
||||
|
||||
VSPlatforms = [ "x86", "x64" ]
|
||||
for ts in SortedToolsets:
|
||||
vs = ByToolset[ts]
|
||||
for platform in VSPlatforms:
|
||||
toolchain = {}
|
||||
toolchain["Generator"] = vs["Name"]
|
||||
toolchain["Platform"] = platform
|
||||
toolchain["Toolset"] = ts
|
||||
toolchain["Prefix"] = FindVSPrefixPaths(ts, platform)
|
||||
Toolchains["MSVC/" + ts + "/" + platform] = toolchain
|
||||
|
||||
with open(os.path.join(NeLConfigDir, "toolchains_default.json"), 'w') as fo:
|
||||
json.dump(Toolchains, fo, indent=2)
|
||||
|
||||
# end of file
|
@ -0,0 +1,128 @@
|
||||
|
||||
# This script detects all external library paths
|
||||
# Useful for locating all dynamic libraries
|
||||
|
||||
from common_config import *
|
||||
|
||||
import os
|
||||
|
||||
def FilterExternalDirs(libs):
|
||||
filterMap = {
|
||||
"assimp": "include/assimp/mesh.h",
|
||||
"boost": "include/boost/algorithm/algorithm.hpp",
|
||||
"curl": "include/curl/curl.h",
|
||||
"ffmpeg": "include/libavcodec/codec.h",
|
||||
"freetype2": "include/freetype2/ft2build.h",
|
||||
"gl": "include/GL/glcorearb.h",
|
||||
"gles": "include/GLES2/gl2.h",
|
||||
"iconv": "include/iconv.h",
|
||||
"libjpeg": "include/jpeglib.h",
|
||||
"libpng": "include/png.h",
|
||||
"libxml2": "include/libxml2/libxml/xmlreader.h",
|
||||
"lua": "include/lua.h",
|
||||
"luabind": "include/luabind/luabind.hpp",
|
||||
"mariadb": "include/mariadb/mysql.h",
|
||||
"msquic": "include/msquic.h",
|
||||
"ogg": "include/ogg/ogg.h",
|
||||
"openal": "include/AL/al.h",
|
||||
"openssl": "include/openssl/opensslconf.h",
|
||||
"protobuf": "include/google/protobuf/message.h",
|
||||
"qt5": "include/QtCore/QBuffer",
|
||||
"squish": "include/squish.h",
|
||||
"vorbis": "include/vorbis/codec.h",
|
||||
"zlib": "include/zlib.h"
|
||||
}
|
||||
res = []
|
||||
for dir in FoundExternalDirs:
|
||||
for lib in libs:
|
||||
file = os.path.join(dir, filterMap[lib])
|
||||
if os.path.isfile(file):
|
||||
res += [ dir ]
|
||||
break
|
||||
return res
|
||||
|
||||
# The list of folders to potentially pass to CMake as PREFIX
|
||||
def FindPrefixPaths(externalDir):
|
||||
def DirHasAny(dir, includeSearch):
|
||||
for search in includeSearch:
|
||||
if os.path.isfile(os.path.join(dir, os.path.normcase(search))):
|
||||
return True
|
||||
return False
|
||||
|
||||
tempExternal = {}
|
||||
tempExternalBinaries = {}
|
||||
|
||||
# Headers to include
|
||||
includeSearch = [
|
||||
"include/assimp/mesh.h",
|
||||
"include/boost/algorithm/algorithm.hpp",
|
||||
"include/curl/curl.h",
|
||||
"include/libavcodec/codec.h",
|
||||
"include/freetype2/ft2build.h",
|
||||
"include/GL/glcorearb.h",
|
||||
"include/GLES2/gl2.h",
|
||||
"include/iconv.h",
|
||||
"include/jpeglib.h",
|
||||
"include/png.h",
|
||||
"include/libxml2/libxml/xmlreader.h",
|
||||
"include/lua.h",
|
||||
"include/luabind/luabind.hpp",
|
||||
"include/mariadb/mysql.h",
|
||||
"include/msquic.h",
|
||||
"include/ogg/ogg.h",
|
||||
"include/AL/al.h",
|
||||
"include/openssl/opensslconf.h",
|
||||
"include/google/protobuf/message.h",
|
||||
"include/QtCore/QBuffer",
|
||||
"include/squish.h",
|
||||
"include/vorbis/codec.h",
|
||||
"include/zlib.h"
|
||||
]
|
||||
|
||||
# Only search one level deep
|
||||
if DirHasAny(externalDir, includeSearch):
|
||||
tempExternal[externalDir] = True
|
||||
for di in os.listdir(externalDir):
|
||||
if di.startswith("."):
|
||||
continue
|
||||
sdi = os.path.join(externalDir, di)
|
||||
if not os.path.isdir(sdi):
|
||||
continue
|
||||
if DirHasAny(sdi, includeSearch):
|
||||
tempExternal[sdi] = True
|
||||
res = []
|
||||
for dir in tempExternal:
|
||||
res += [ dir ]
|
||||
return res
|
||||
|
||||
# The list of folders to potentially pass into the Visual Studio debug PATH env var
|
||||
def FindBinPaths(prefixPaths):
|
||||
for dir in prefixPaths:
|
||||
for subDir in os.listdir(dir):
|
||||
if subDir.startswith("."):
|
||||
continue
|
||||
binDir = os.path.join(dir, subDir)
|
||||
if not os.path.isdir(binDir):
|
||||
continue
|
||||
for file in os.listdir(binDir):
|
||||
if not file.startswith(".") and (file.endswith(".exe") or file.endswith(".dll")):
|
||||
tempExternalBinaries[binDir] = True
|
||||
break
|
||||
res = []
|
||||
for dir in tempExternalBinaries:
|
||||
res += [ dir ]
|
||||
return res
|
||||
|
||||
def FindVSPrefixPaths(toolset, platform):
|
||||
# 2021q4_external_v143_x64
|
||||
dirExt = "_external_" + toolset + "_" + platform
|
||||
found = []
|
||||
for dir in os.listdir("C:\\"):
|
||||
if not dir.startswith(".") and dir.endswith(dirExt):
|
||||
found += [ dir ]
|
||||
found.sort(reverse = True)
|
||||
if len(found):
|
||||
return FindPrefixPaths(os.path.join("C:\\", found[0]))
|
||||
return []
|
||||
|
||||
# end of file
|
@ -1 +1 @@
|
||||
..\..\..\external\python27\python.exe find_vstudio.py
|
||||
..\..\..\external\python27\python.exe configure_toolchains.py
|
||||
|
Loading…
Reference in New Issue