[zorg] r273498 - Added CmakeCommand as now this is a standard way to build.

Galina Kistanova via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 15:06:12 PDT 2016


Author: gkistanova
Date: Wed Jun 22 17:06:11 2016
New Revision: 273498

URL: http://llvm.org/viewvc/llvm-project?rev=273498&view=rev
Log:
Added CmakeCommand as now this is a standard way to build.

Added:
    zorg/trunk/zorg/buildbot/commands/CmakeCommand.py
Modified:
    zorg/trunk/zorg/buildbot/commands/__init__.py

Added: zorg/trunk/zorg/buildbot/commands/CmakeCommand.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/CmakeCommand.py?rev=273498&view=auto
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/CmakeCommand.py (added)
+++ zorg/trunk/zorg/buildbot/commands/CmakeCommand.py Wed Jun 22 17:06:11 2016
@@ -0,0 +1,47 @@
+from buildbot.process.properties import WithProperties
+from buildbot.steps.shell import WarningCountingShellCommand
+
+class CmakeCommand(WarningCountingShellCommand):
+
+    def __init__(self, prefixCommand=None, options=None, path=None, **kwargs):
+        self.prefixCommand = prefixCommand
+        self.path = [path]
+
+        if options is None:
+            self.options = list()
+        else:
+            self.options = list(options)
+
+        command = []
+        if prefixCommand:
+            command += prefixCommand
+
+        command += ["cmake"]
+
+        # Set some default options.
+
+        if not any(a.startswith('-DCMAKE_BUILD_TYPE=')   for a in self.options):
+            self.options.append('-DCMAKE_BUILD_TYPE=Release')
+        if not any(a.startswith('-DLLVM_ENABLE_WERROR=') for a in self.options):
+            self.options.append('-DLLVM_ENABLE_WERROR=ON')
+        if self.options:
+            command += self.options
+
+        if self.path:
+            command += self.path
+
+        # Note: We will remove all the empty items from the command at start.
+        kwargs['command'] = command
+
+        # And upcall to let the base class do its work
+        WarningCountingShellCommand.__init__(self, **kwargs)
+
+        self.addFactoryArguments(prefixCommand=prefixCommand,
+                                 options=self.options,
+                                 path=path)
+
+    def start(self):
+        # Don't forget to remove all the empty items from the command,
+        # which we could get because of WithProperties rendered as empty strings.
+        self.command = filter(bool, self.command)
+        # Then upcall.

Modified: zorg/trunk/zorg/buildbot/commands/__init__.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/__init__.py?rev=273498&r1=273497&r2=273498&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/__init__.py (original)
+++ zorg/trunk/zorg/buildbot/commands/__init__.py Wed Jun 22 17:06:11 2016
@@ -5,5 +5,6 @@ import SuppressionDejaGNUCommand
 import DejaGNUCommand
 import GTestCommand
 import NinjaCommand
+import CmakeCommand
 
 __all__ = []




More information about the llvm-commits mailing list