mirror of
https://github.com/ModOrganizer2/modorganizer-umbrella.git
synced 2026-07-27 13:58:32 -07:00
Differentiate between VS and VC version
This commit is contained in:
@@ -112,10 +112,10 @@ config = {
|
||||
'qt_version_minor': '0',
|
||||
'qt_version_appveyor': '5.15',
|
||||
'qt_version_minor_appveyor': '0',
|
||||
'qt_vc_version': '16.0',
|
||||
'qt_vs_version': '16.0',
|
||||
'vc_platformtoolset': 'v142',
|
||||
'vc_TargetPlatformVersion': '10.0.19041.0',
|
||||
'vc_version': '16.0',
|
||||
'vs_version': '16.0',
|
||||
'vc_version_for_boost': '14.2',
|
||||
'WixToolset_version': '311',
|
||||
'zlib_version': '1.2.11',
|
||||
|
||||
@@ -175,7 +175,7 @@ class CMakeEdit(Builder):
|
||||
def __generator_name(self):
|
||||
if self.__type == CMakeEdit.Type.VC:
|
||||
return "Visual Studio {} {}" \
|
||||
.format(config['vc_version'].split('.')[0], self.__vc_year(config['vc_version']))
|
||||
.format(config['vs_version'].split('.')[0], self.__vc_year(config['vs_version']))
|
||||
elif self.__type == CMakeEdit.Type.CodeBlocks:
|
||||
return "CodeBlocks - NMake Makefiles"
|
||||
|
||||
@@ -254,7 +254,7 @@ class CMakeVS(Builder):
|
||||
soutpath = os.path.join(self._context["build_path"], "vs_stdout.log")
|
||||
serrpath = os.path.join(self._context["build_path"], "vs_stderr.log")
|
||||
|
||||
vs_generator = "Visual Studio {0} {1}".format(config['vc_version'].split(".", 1)[0],vc_year(config['vc_version']))
|
||||
vs_generator = "Visual Studio {0} {1}".format(config['vs_version'].split(".", 1)[0],vc_year(config['vs_version']))
|
||||
# Updated for latest versions of CMake > 3.1 - VS 2019 does not allow use of the deprecated method
|
||||
vs_generator_arch = "x64"
|
||||
if config["architecture"] == "x86":
|
||||
|
||||
@@ -49,7 +49,7 @@ def upgrade_args():
|
||||
return [os.path.join(devenv_path, "devenv.exe"),
|
||||
os.path.join(lz_path, "visual", "VS2017", 'lz4.sln'),
|
||||
"/upgrade"]
|
||||
return [os.path.join(get_visual_studio(config["vc_version"]), "..", "..", "..", "Common7", "IDE", "devenv.exe"),
|
||||
return [os.path.join(get_visual_studio(config["vs_version"]), "..", "..", "..", "Common7", "IDE", "devenv.exe"),
|
||||
os.path.join(lz_path, "visual", "VS2017", 'lz4.sln'), "/upgrade"]
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ def upgrade_args():
|
||||
return [os.path.join(devenv_path, "devenv.exe"),
|
||||
"PCBuild/pcbuild.sln",
|
||||
"/upgrade"]
|
||||
return [os.path.join(get_visual_studio(config["vc_version"]), "..", "..", "..", "Common7", "IDE", "devenv.exe"),
|
||||
return [os.path.join(get_visual_studio(config["vs_version"]), "..", "..", "..", "Common7", "IDE", "devenv.exe"),
|
||||
"PCBuild/pcbuild.sln", "/upgrade"]
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ def bitnessQt():
|
||||
|
||||
|
||||
def variant():
|
||||
return "msvc2013" if config['qt_vc_version'] == "12.0" else "msvc2015" if config['qt_vc_version'] == "14.0" else "msvc2017" if config['qt_vc_version'] == "15.0" else "msvc2019"
|
||||
return "msvc2013" if config['qt_vs_version'] == "12.0" else "msvc2015" if config['qt_vs_version'] == "14.0" else "msvc2017" if config['qt_vs_version'] == "15.0" else "msvc2019"
|
||||
|
||||
qt_bin_variant = variant()
|
||||
platform = "win32-{0}".format(variant())
|
||||
|
||||
@@ -82,12 +82,12 @@ def init_config(args):
|
||||
if config['architecture'] not in ['x86_64', 'x86']:
|
||||
raise ValueError("only architectures supported are x86 and x86_64")
|
||||
|
||||
visual_studio(config["vc_version"]) # forced set after args are evaluated
|
||||
visual_studio(config["vs_version"]) # forced set after args are evaluated
|
||||
if config['prefer_binary_dependencies']:
|
||||
if os.environ.get('APPVEYOR') is not None:
|
||||
qt_install(config["qt_version_appveyor"], config["qt_version_minor_appveyor"], config["qt_vc_version"])
|
||||
qt_install(config["qt_version_appveyor"], config["qt_version_minor_appveyor"], config["qt_vs_version"])
|
||||
else:
|
||||
qt_install(config["qt_version"], config["qt_version_minor"], config["qt_vc_version"])
|
||||
qt_install(config["qt_version"], config["qt_version_minor"], config["qt_vs_version"])
|
||||
config['__Default_environment'] = os.environ
|
||||
config['__environment'] = visual_studio_environment()
|
||||
config['__build_base_path'] = os.path.abspath(args.destination)
|
||||
@@ -117,7 +117,7 @@ def dump_config():
|
||||
logging.debug(" Config: config['paths']['python']=%s", Evaluate(config['paths']['python']))
|
||||
logging.debug(" Config: config['paths']['visual_studio']=%s", config['paths']['visual_studio'])
|
||||
logging.debug(" Config: config['paths']['qt_binary_install']=%s", config['paths']['qt_binary_install'])
|
||||
logging.debug(" Config: config['vc_version']=%s", config['vc_version'])
|
||||
logging.debug(" Config: config['vs_version']=%s", config['vs_version'])
|
||||
|
||||
|
||||
def check_config():
|
||||
|
||||
@@ -25,12 +25,12 @@ from unibuild.utility.config_utility import program_files_folders
|
||||
from unibuild.utility.visualstudio import vc_year
|
||||
|
||||
|
||||
def get_qt_install(qt_version, qt_version_minor, vc_version):
|
||||
def get_qt_install(qt_version, qt_version_minor, vs_version):
|
||||
# Start with the custom Qt install path, overrides automatic detection
|
||||
try:
|
||||
p = os.path.join(config['qt_CustomInstallPath'], "{}".format(qt_version + "." + qt_version_minor
|
||||
if qt_version_minor != '' else qt_version),
|
||||
"msvc{0}_64".format(vc_year(vc_version)))
|
||||
"msvc{0}_64".format(vc_year(vs_version)))
|
||||
f = os.path.join(p, "bin", "qmake.exe")
|
||||
if os.path.isfile(f):
|
||||
return os.path.realpath(p)
|
||||
@@ -42,14 +42,14 @@ def get_qt_install(qt_version, qt_version_minor, vc_version):
|
||||
# Offline installer default location
|
||||
p = os.path.join(baselocation, "Qt", "Qt{}".format(qt_version + "." + qt_version_minor
|
||||
if qt_version_minor != '' else qt_version), "{}".format(qt_version + "." + qt_version_minor
|
||||
if qt_version_minor != '' else qt_version), "msvc{0}_64".format(vc_year(vc_version)))
|
||||
if qt_version_minor != '' else qt_version), "msvc{0}_64".format(vc_year(vs_version)))
|
||||
f = os.path.join(p, "bin", "qmake.exe")
|
||||
if os.path.isfile(f):
|
||||
return os.path.realpath(p)
|
||||
# Online installer default location
|
||||
p = os.path.join(baselocation, "Qt", "{}".format(qt_version + "." + qt_version_minor
|
||||
if qt_version_minor != '' else qt_version),
|
||||
"msvc{0}_64".format(vc_year(vc_version)))
|
||||
"msvc{0}_64".format(vc_year(vs_version)))
|
||||
f = os.path.join(p, "bin", "qmake.exe")
|
||||
if os.path.isfile(f):
|
||||
return os.path.realpath(p)
|
||||
@@ -73,7 +73,7 @@ def get_qt_install(qt_version, qt_version_minor, vc_version):
|
||||
|
||||
p = os.path.join(root, "{}".format(qt_version + "." + qt_version_minor
|
||||
if qt_version_minor != '' else qt_version),
|
||||
"msvc{0}_64".format(vc_year(vc_version)))
|
||||
"msvc{0}_64".format(vc_year(vs_version)))
|
||||
f = os.path.join(p, "bin", "qmake.exe")
|
||||
if os.path.isfile(f):
|
||||
return os.path.realpath(p)
|
||||
@@ -83,8 +83,8 @@ def get_qt_install(qt_version, qt_version_minor, vc_version):
|
||||
return None
|
||||
|
||||
|
||||
def qt_install(qt_version, qt_version_minor, vc_version):
|
||||
config["paths"]["qt_binary_install"] = get_qt_install(qt_version, qt_version_minor, vc_version)
|
||||
def qt_install(qt_version, qt_version_minor, vs_version):
|
||||
config["paths"]["qt_binary_install"] = get_qt_install(qt_version, qt_version_minor, vs_version)
|
||||
if not config["paths"]["qt_binary_install"]:
|
||||
if qt_version_minor != '':
|
||||
qt_v = qt_version + "." + qt_version_minor
|
||||
|
||||
@@ -32,9 +32,9 @@ vs_editions = ["enterprise",
|
||||
|
||||
|
||||
# No entries for vs 2017 in the stadard registry, check environment then look in the default installation dir
|
||||
def get_visual_studio(vc_version):
|
||||
def get_visual_studio(vs_version):
|
||||
try:
|
||||
if os.environ["VisualStudioVersion"] == vc_version:
|
||||
if os.environ["VisualStudioVersion"] == vs_version:
|
||||
p = os.path.join(os.environ["VSINSTALLDIR"], "VC", "Auxiliary", "Build")
|
||||
f = os.path.join(p, "vcvarsall.bat")
|
||||
res = os.path.isfile(f)
|
||||
@@ -60,25 +60,25 @@ def get_visual_studio(vc_version):
|
||||
|
||||
for edition in vs_editions:
|
||||
s = os.environ["ProgramFiles(x86)"]
|
||||
p = os.path.join(s, "Microsoft Visual Studio", vc_year(vc_version), edition, "VC", "Auxiliary", "Build")
|
||||
p = os.path.join(s, "Microsoft Visual Studio", vc_year(vs_version), edition, "VC", "Auxiliary", "Build")
|
||||
f = os.path.join(p, "vcvarsall.bat")
|
||||
if os.path.isfile(f):
|
||||
config['paths']['visual_studio_basedir'] = os.path.join(s, "Microsoft Visual Studio", vc_year(vc_version),
|
||||
config['paths']['visual_studio_basedir'] = os.path.join(s, "Microsoft Visual Studio", vc_year(vs_version),
|
||||
edition)
|
||||
return os.path.realpath(p)
|
||||
|
||||
|
||||
def vc_year(vc_version):
|
||||
if vc_version == "15.0":
|
||||
def vc_year(vs_version):
|
||||
if vs_version == "15.0":
|
||||
return "2017"
|
||||
elif vc_version == "16.0":
|
||||
elif vs_version == "16.0":
|
||||
return "2019"
|
||||
else:
|
||||
logging.error("Visual Studio %s is not supported", vc_version)
|
||||
logging.error("Visual Studio %s is not supported", vs_version)
|
||||
|
||||
|
||||
def visual_studio(vc_version):
|
||||
config["paths"]["visual_studio"] = get_visual_studio(vc_version)
|
||||
def visual_studio(vs_version):
|
||||
config["paths"]["visual_studio"] = get_visual_studio(vs_version)
|
||||
if not config["paths"]["visual_studio"]:
|
||||
logging.error("Unable to find vcvarsall.bat, please make sure you have 'Common C++ tools' Installed."
|
||||
" If you have changed the default installation folder for VS please set the 'vc_CustomInstallPath' in the config.py file"
|
||||
|
||||
Reference in New Issue
Block a user