[zorg] r297434 - Added support for MSVC build.
Galina Kistanova via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 9 17:06:36 PST 2017
Author: gkistanova
Date: Thu Mar 9 19:06:35 2017
New Revision: 297434
URL: http://llvm.org/viewvc/llvm-project?rev=297434&view=rev
Log:
Added support for MSVC build.
Modified:
zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py
Modified: zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py?rev=297434&r1=297433&r2=297434&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py Thu Mar 9 19:06:35 2017
@@ -1,5 +1,6 @@
from buildbot.steps.slave import RemoveDirectory
-from buildbot.process.properties import WithProperties
+from buildbot.process.properties import WithProperties, Property
+from buildbot.steps.shell import SetProperty
from zorg.buildbot.commands.CmakeCommand import CmakeCommand
from zorg.buildbot.commands.NinjaCommand import NinjaCommand
@@ -7,6 +8,8 @@ from zorg.buildbot.commands.NinjaCommand
from zorg.buildbot.conditions.FileConditions import FileDoesNotExist
from zorg.buildbot.process.factory import LLVMBuildFactory
+import zorg.buildbot.builders.Util as builders_util
+
def getLLVMBuildFactoryAndSVNSteps(
depends_on_projects = None,
llvm_srcdir = None,
@@ -202,6 +205,7 @@ def getCmakeBuildFactory(
return f
+
def getCmakeWithNinjaBuildFactory(
depends_on_projects = None,
llvm_srcdir = None,
@@ -235,6 +239,70 @@ def getCmakeWithNinjaBuildFactory(
addNinjaSteps(
f,
+ obj_dir=obj_dir,
+ env=env,
+ **kwargs)
+
+ return f
+
+def getCmakeWithNinjaWithMSVCBuildFactory(
+ depends_on_projects = None,
+ llvm_srcdir = None,
+ obj_dir = None,
+ install_dir = None,
+ clean = False,
+ extra_configure_args = None,
+ # VS tools environment variable if using MSVC. For example,
+ # %VS140COMNTOOLS% selects the 2015 toolchain.
+ vs=None,
+ target_arch=None,
+ env = None,
+ **kwargs):
+
+ assert not env, "Can't have custom builder env vars with MSVC build"
+
+ # Make a local copy of the configure args, as we are going to modify that.
+ if extra_configure_args:
+ cmake_args = extra_configure_args[:]
+ else:
+ cmake_args = list()
+
+ # Set up VS environment, if appropriate.
+ if not vs:
+ # We build by Visual Studio 2015, unless otherwise is requested.
+ vs=r"""%VS140COMNTOOLS%"""
+
+ cleanBuildRequested = lambda step: step.build.getProperty("clean") or clean
+
+ f = getLLVMBuildFactoryAndSVNSteps(
+ depends_on_projects=depends_on_projects,
+ llvm_srcdir=llvm_srcdir,
+ obj_dir=obj_dir,
+ install_dir=install_dir,
+ cleanBuildRequested=cleanBuildRequested,
+ **kwargs) # Pass through all the extra arguments.
+
+ f.addStep(SetProperty(
+ command=builders_util.getVisualStudioEnvironment(vs, target_arch),
+ extract_fn=builders_util.extractSlaveEnvironment))
+ env = Property('slave_env')
+
+ # Some options are required for this build no matter what.
+ CmakeCommand.applyRequiredOptions(cmake_args, [
+ ('-G', 'Ninja'),
+ ])
+
+ addCmakeSteps(
+ f,
+ f.cleanBuildRequested,
+ obj_dir=f.obj_dir,
+ install_dir=f.install_dir,
+ extra_configure_args=cmake_args,
+ env=env,
+ **kwargs)
+
+ addNinjaSteps(
+ f,
obj_dir=obj_dir,
env=env,
**kwargs)
More information about the llvm-commits
mailing list