summaryrefslogtreecommitdiff
path: root/scripts/Util.py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-06-16 17:59:28 +0200
committerJose <jose@zeroc.com>2017-06-16 17:59:28 +0200
commit776279b845b1834a126cbc86ae39e86e2de59e80 (patch)
treea7035cc3efb2394bb764c2d0ac71ce5393b888f8 /scripts/Util.py
parentFixed iOS/UWP testing to ignore --workers, it's not supported yet (diff)
downloadice-776279b845b1834a126cbc86ae39e86e2de59e80.tar.bz2
ice-776279b845b1834a126cbc86ae39e86e2de59e80.tar.xz
ice-776279b845b1834a126cbc86ae39e86e2de59e80.zip
Fix (ICE-8069) - Util.py improve errors if C++ binary distribution was not detected
Diffstat (limited to 'scripts/Util.py')
-rw-r--r--scripts/Util.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/scripts/Util.py b/scripts/Util.py
index 1736610875a..902079e76a0 100644
--- a/scripts/Util.py
+++ b/scripts/Util.py
@@ -244,7 +244,12 @@ class Windows(Platform):
"Ice/plugin",
"Ice/threadPoolPriority"])
elif self.getCompiler() in ["VC100"]:
- return (["cpp/Ice/.*", "cpp/IceSSL/.*", "cpp/IceBox/.*", "cpp/IceDiscovery/.*", "cpp/IceUtil/.*", "cpp/Slice/.*"], [])
+ return (["cpp/Ice/.*",
+ "cpp/IceSSL/.*",
+ "cpp/IceBox/.*",
+ "cpp/IceDiscovery/.*",
+ "cpp/IceUtil/.*",
+ "cpp/Slice/.*"], [])
elif self.getCompiler() not in ["VC140"]:
return ([], ["python", "php", "ruby"])
else:
@@ -260,7 +265,7 @@ class Windows(Platform):
return "Release"
def getCompiler(self):
- if self.compiler:
+ if self.compiler != None:
return self.compiler
if os.environ.get("CPP_COMPILER", "") != "":
self.compiler = os.environ["CPP_COMPILER"]
@@ -278,7 +283,7 @@ class Windows(Platform):
elif out.find("Version 19.10.") != -1:
self.compiler = "VC141"
except:
- pass
+ self.compiler = ""
return self.compiler
def getNugetPackageVersion(self):
@@ -303,8 +308,10 @@ class Windows(Platform):
packageSuffix = self.getPlatformToolset() if isinstance(mapping, CppMapping) else "net"
package = os.path.join(mapping.path, "msbuild", "packages", "{0}".format(
mapping.getNugetPackage(packageSuffix, version))) if hasattr(mapping, "getNugetPackage") else None
-
nuget = package and os.path.exists(package)
+ iceHome = os.environ.get("ICE_HOME", "")
+ if isinstance(mapping, CppMapping) and not nuget and not os.path.exists(iceHome):
+ raise RuntimeError("Cannot detect a valid C++ distribution")
if not nuget:
return "bin"
elif isinstance(mapping, CSharpMapping) or isinstance(process, SliceTranslator):
@@ -349,7 +356,12 @@ class Windows(Platform):
packageSuffix = self.getPlatformToolset() if isinstance(mapping, CppMapping) else "net"
package = os.path.join(mapping.path, "msbuild", "packages", "{0}".format(
mapping.getNugetPackage(packageSuffix, version))) if hasattr(mapping, "getNugetPackage") else None
- return package if package and os.path.exists(package) else os.environ.get("ICE_HOME")
+
+ iceHome = os.environ.get("ICE_HOME", "")
+ if isinstance(mapping, CppMapping) and not package and not os.path.exists(iceHome):
+ raise RuntimeError("Cannot detect a valid C++ distribution")
+
+ return package if package and os.path.exists(package) else iceHome
def canRun(self, mapping, current):
#