From f53658ab9f433b202f147f6e2962d7fdb58cd2e0 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Mon, 9 Oct 2017 15:16:56 +0200 Subject: [PATCH] Fixed MSVC build. cd qt5 was reset after call'ing vcvarsall.bat on VS 2017. --- conanfile.py | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/conanfile.py b/conanfile.py index 997be5e..8da9166 100644 --- a/conanfile.py +++ b/conanfile.py @@ -186,28 +186,22 @@ def _build_msvc(self, args): env_build = VisualStudioBuildEnvironment(self) env.update(env_build.vars) + vcvars = tools.vcvars_command(self.settings) - # Workaround for conan-io/conan#1408 - for name, value in env.items(): - if not value: - del env[name] - with tools.environment_append(env): - vcvars = tools.vcvars_command(self.settings) - - args += ["-opengl %s" % self.options.opengl] - if self.options.openssl == "no": - args += ["-no-openssl"] - elif self.options.openssl == "yes": - args += ["-openssl"] - else: - args += ["-openssl-linked"] + args += ["-opengl %s" % self.options.opengl] + if self.options.openssl == "no": + args += ["-no-openssl"] + elif self.options.openssl == "yes": + args += ["-openssl"] + else: + args += ["-openssl-linked"] - self.run("cd %s && %s && set" % (self.source_dir, vcvars)) - self.run("cd %s && %s && configure %s" - % (self.source_dir, vcvars, " ".join(args))) - self.run("cd %s && %s && %s %s" - % (self.source_dir, vcvars, build_command, " ".join(build_args))) - self.run("cd %s && %s && %s install" % (self.source_dir, vcvars, build_command)) + self.run("%s && cd %s && set" % (vcvars, self.source_dir)) + self.run("%s && cd %s && configure %s" + % (vcvars, self.source_dir, " ".join(args))) + self.run("%s && cd %s && %s %s" + % (vcvars, self.source_dir, build_command, " ".join(build_args))) + self.run("%s && cd %s && %s install" % (vcvars, self.source_dir, build_command)) def _build_mingw(self, args): env_build = AutoToolsBuildEnvironment(self)