Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 1 | import os |
| 2 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 3 | import buildbot |
| 4 | import buildbot.process.factory |
| 5 | from buildbot.steps.source import SVN |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 6 | from buildbot.steps.shell import Configure, ShellCommand |
| 7 | from buildbot.steps.shell import WarningCountingShellCommand |
| 8 | from buildbot.steps.transfer import FileDownload |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 9 | from buildbot.process.properties import WithProperties |
| 10 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 11 | from zorg.buildbot.commands.ClangTestCommand import ClangTestCommand |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 12 | from zorg.buildbot.commands.BatchFileDownload import BatchFileDownload |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 13 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 14 | from Util import getConfigArgs |
| 15 | |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 16 | def getClangBuildFactory(triple=None, clean=True, test=True, package_dst=None, |
| 17 | run_cxx_tests=False, examples=False, valgrind=False, |
Daniel Dunbar | a1bebce | 2010-03-21 01:24:00 +0000 | [diff] [blame] | 18 | valgrindLeakCheck=False, outOfDir=False, useTwoStage=False, |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 19 | completely_clean=False, always_install=False, |
| 20 | make='make', jobs="%(jobs)s", |
Daniel Dunbar | 7e33e04 | 2010-07-14 20:34:16 +0000 | [diff] [blame] | 21 | stage1_config='Debug+Asserts', |
| 22 | stage2_config='Release+Asserts', |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 23 | extra_configure_args=[], use_pty_in_tests=False): |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 24 | # Don't use in-dir builds with a two stage build process. |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 25 | inDir = not outOfDir and not useTwoStage |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 26 | if inDir: |
| 27 | llvm_srcdir = "llvm" |
| 28 | llvm_1_objdir = "llvm" |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 29 | if always_install: |
| 30 | llvm_1_installdir = "llvm.install" |
| 31 | else: |
| 32 | llvm_1_installdir = None |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 33 | else: |
| 34 | llvm_srcdir = "llvm.src" |
| 35 | llvm_1_objdir = "llvm.obj" |
| 36 | llvm_1_installdir = "llvm.install.1" |
| 37 | llvm_2_objdir = "llvm.obj.2" |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 38 | llvm_2_installdir = "llvm.install.2" |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 39 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 40 | f = buildbot.process.factory.BuildFactory() |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 41 | |
| 42 | # Determine the build directory. |
| 43 | f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir", |
| 44 | command=["pwd"], |
| 45 | property="builddir", |
| 46 | description="set build dir", |
| 47 | workdir=".")) |
| 48 | |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 49 | # Blow away completely, if requested. |
| 50 | if completely_clean: |
| 51 | f.addStep(ShellCommand(name="rm-llvm.src", |
| 52 | command=["rm", "-rf", llvm_srcdir], |
| 53 | haltOnFailure=True, |
| 54 | description=["rm src dir", "llvm"], |
| 55 | workdir=".")) |
| 56 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 57 | # Checkout sources. |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 58 | f.addStep(SVN(name='svn-llvm', |
| 59 | mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/', |
| 60 | defaultBranch='trunk', |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 61 | workdir=llvm_srcdir)) |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 62 | f.addStep(SVN(name='svn-clang', |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 63 | mode='update', baseURL='http://llvm.org/svn/llvm-project/cfe/', |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 64 | defaultBranch='trunk', |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 65 | workdir='%s/tools/clang' % llvm_srcdir)) |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 66 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 67 | # Clean up llvm (stage 1); unless in-dir. |
| 68 | if clean and llvm_srcdir != llvm_1_objdir: |
| 69 | f.addStep(ShellCommand(name="rm-llvm.obj.stage1", |
| 70 | command=["rm", "-rf", llvm_1_objdir], |
| 71 | haltOnFailure=True, |
| 72 | description=["rm build dir", "llvm"], |
| 73 | workdir=".")) |
| 74 | |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 75 | # Force without llvm-gcc so we don't run afoul of Frontend test failures. |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 76 | base_configure_args = [WithProperties("%%(builddir)s/%s/configure" % llvm_srcdir), |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 77 | '--disable-bindings'] |
| 78 | base_configure_args += extra_configure_args |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 79 | if triple: |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 80 | base_configure_args += ['--build=%s' % triple, |
| 81 | '--host=%s' % triple, |
| 82 | '--target=%s' % triple] |
| 83 | args = base_configure_args + ["--without-llvmgcc", "--without-llvmgxx"] |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 84 | args.append(WithProperties("--prefix=%%(builddir)s/%s" % llvm_1_installdir)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 85 | args += getConfigArgs(stage1_config) |
| 86 | f.addStep(Configure(command=args, |
| 87 | workdir=llvm_1_objdir, |
| 88 | description=['configuring',stage1_config], |
| 89 | descriptionDone=['configure',stage1_config])) |
| 90 | |
| 91 | # Make clean if using in-dir builds. |
| 92 | if clean and llvm_srcdir == llvm_1_objdir: |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 93 | f.addStep(WarningCountingShellCommand(name="clean-llvm", |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 94 | command=[make, "clean"], |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 95 | haltOnFailure=True, |
| 96 | description="cleaning llvm", |
| 97 | descriptionDone="clean llvm", |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 98 | workdir=llvm_1_objdir)) |
| 99 | |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 100 | f.addStep(WarningCountingShellCommand(name="compile", |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 101 | command=['nice', '-n', '10', |
| 102 | make, WithProperties("-j%s" % jobs)], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 103 | haltOnFailure=True, |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 104 | description=["compiling", stage1_config], |
| 105 | descriptionDone=["compile", stage1_config], |
| 106 | workdir=llvm_1_objdir)) |
Daniel Dunbar | 256fed4 | 2009-11-25 21:11:08 +0000 | [diff] [blame] | 107 | |
| 108 | if examples: |
| 109 | f.addStep(WarningCountingShellCommand(name="compile.examples", |
| 110 | command=['nice', '-n', '10', |
| 111 | make, WithProperties("-j%s" % jobs), |
| 112 | "BUILD_EXAMPLES=1"], |
| 113 | haltOnFailure=True, |
| 114 | description=["compilinge", stage1_config, "examples"], |
| 115 | descriptionDone=["compile", stage1_config, "examples"], |
| 116 | workdir=llvm_1_objdir)) |
| 117 | |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 118 | clangTestArgs = llvmTestArgs = '-v -j %s' % jobs |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 119 | if valgrind: |
Daniel Dunbar | 89184b9 | 2010-04-18 19:09:32 +0000 | [diff] [blame] | 120 | clangTestArgs += ' --vg' |
Daniel Dunbar | a1bebce | 2010-03-21 01:24:00 +0000 | [diff] [blame] | 121 | if valgrindLeakCheck: |
| 122 | clangTestArgs += ' --vg-leak' |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 123 | clangTestArgs += ' --vg-arg --suppressions=%(builddir)s/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp' |
| 124 | extraTestDirs = '' |
| 125 | if run_cxx_tests: |
| 126 | extraTestDirs += '%(builddir)s/llvm/tools/clang/utils/C++Tests' |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 127 | if test: |
| 128 | f.addStep(ClangTestCommand(name='test-llvm', |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 129 | command=[make, "check-lit", "VERBOSE=1", |
| 130 | WithProperties("LIT_ARGS=%s" % llvmTestArgs)], |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 131 | description=["testing", "llvm"], |
| 132 | descriptionDone=["test", "llvm"], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 133 | workdir=llvm_1_objdir, |
| 134 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 135 | f.addStep(ClangTestCommand(name='test-clang', |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 136 | command=[make, 'test', WithProperties('TESTARGS=%s' % clangTestArgs), |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 137 | WithProperties('EXTRA_TESTDIRS=%s' % extraTestDirs)], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 138 | workdir='%s/tools/clang' % llvm_1_objdir, |
| 139 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 140 | |
| 141 | # Install llvm and clang. |
| 142 | if llvm_1_installdir: |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 143 | f.addStep(ShellCommand(name="rm-install.clang.stage1", |
| 144 | command=["rm", "-rf", llvm_1_installdir], |
| 145 | haltOnFailure=True, |
| 146 | description=["rm install dir", "clang"], |
| 147 | workdir=".")) |
| 148 | f.addStep(WarningCountingShellCommand(name="install.clang.stage1", |
| 149 | command = ['nice', '-n', '10', |
| 150 | make, 'install-clang'], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 151 | haltOnFailure=True, |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 152 | description=["install", "clang", |
| 153 | stage1_config], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 154 | workdir=llvm_1_objdir)) |
| 155 | |
| 156 | if not useTwoStage: |
| 157 | return f |
| 158 | |
| 159 | # Clean up llvm (stage 2). |
| 160 | if clean: |
| 161 | f.addStep(ShellCommand(name="rm-llvm.obj.stage2", |
| 162 | command=["rm", "-rf", llvm_2_objdir], |
| 163 | haltOnFailure=True, |
| 164 | description=["rm build dir", "llvm", "(stage 2)"], |
| 165 | workdir=".")) |
| 166 | |
| 167 | # Configure llvm (stage 2). |
| 168 | args = base_configure_args + ["--without-llvmgcc", "--without-llvmgxx"] |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 169 | args.append(WithProperties("--prefix=%(builddir)s/" + llvm_2_installdir)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 170 | args += getConfigArgs(stage2_config) |
| 171 | f.addStep(Configure(name="configure.llvm.stage2", |
| 172 | command=args, |
| 173 | env={'CC' : WithProperties("%%(builddir)s/%s/bin/clang" % llvm_1_installdir), |
| 174 | 'CXX' : WithProperties("%%(builddir)s/%s/bin/clang++" % llvm_1_installdir),}, |
| 175 | haltOnFailure=True, |
| 176 | workdir=llvm_2_objdir, |
| 177 | description=["configure", "llvm", "(stage 2)", |
| 178 | stage2_config])) |
| 179 | |
| 180 | # Build llvm (stage 2). |
| 181 | f.addStep(WarningCountingShellCommand(name="compile.llvm.stage2", |
| 182 | command=['nice', '-n', '10', |
| 183 | make, WithProperties("-j%s" % jobs)], |
| 184 | haltOnFailure=True, |
| 185 | description=["compiling", "(stage 2)", |
| 186 | stage2_config], |
| 187 | descriptionDone=["compile", "(stage 2)", |
| 188 | stage2_config], |
| 189 | workdir=llvm_2_objdir)) |
| 190 | |
| 191 | if test: |
| 192 | f.addStep(ClangTestCommand(name='test-llvm', |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 193 | command=[make, "check-lit", "VERBOSE=1", |
| 194 | WithProperties("LIT_ARGS=%s" % llvmTestArgs)], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 195 | description=["testing", "llvm"], |
| 196 | descriptionDone=["test", "llvm"], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 197 | workdir=llvm_2_objdir, |
| 198 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 199 | f.addStep(ClangTestCommand(name='test-clang', |
| 200 | command=[make, 'test', WithProperties('TESTARGS=%s' % clangTestArgs), |
| 201 | WithProperties('EXTRA_TESTDIRS=%s' % extraTestDirs)], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 202 | workdir='%s/tools/clang' % llvm_2_objdir, |
| 203 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 204 | |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 205 | # Install clang (stage 2). |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 206 | f.addStep(ShellCommand(name="rm-install.clang.stage2", |
| 207 | command=["rm", "-rf", llvm_2_installdir], |
| 208 | haltOnFailure=True, |
| 209 | description=["rm install dir", "clang"], |
| 210 | workdir=".")) |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 211 | f.addStep(WarningCountingShellCommand(name="install.clang.stage2", |
| 212 | command = ['nice', '-n', '10', |
| 213 | make, 'install-clang'], |
| 214 | haltOnFailure=True, |
| 215 | description=["install", "clang", |
| 216 | "(stage 2)"], |
| 217 | workdir=llvm_2_objdir)) |
| 218 | |
| 219 | if package_dst: |
| 220 | name = WithProperties( |
| 221 | "%(builddir)s/" + llvm_2_objdir + |
| 222 | "/clang-r%(got_revision)s-b%(buildnumber)s.tgz") |
| 223 | f.addStep(ShellCommand(name='pkg.tar', |
| 224 | description="tar root", |
| 225 | command=["tar", "zcvf", name, "./"], |
| 226 | workdir=llvm_2_installdir, |
| 227 | warnOnFailure=True, |
| 228 | flunkOnFailure=False, |
| 229 | haltOnFailure=False)) |
| 230 | f.addStep(ShellCommand(name='pkg.upload', |
| 231 | description="upload root", |
| 232 | command=["scp", name, |
| 233 | WithProperties( |
| 234 | package_dst + "/%(buildername)s")], |
| 235 | workdir=".", |
| 236 | warnOnFailure=True, |
| 237 | flunkOnFailure=False, |
| 238 | haltOnFailure=False)) |
| 239 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 240 | return f |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 241 | |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 242 | def getClangMSVCBuildFactory(update=True, clean=True, vcDrive='c', jobs=1, |
| 243 | cmake=r"c:\Program Files\CMake 2.6\bin\cmake"): |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 244 | f = buildbot.process.factory.BuildFactory() |
| 245 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 246 | if update: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 247 | f.addStep(SVN(name='svn-llvm', |
| 248 | mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/', |
| 249 | defaultBranch='trunk', |
| 250 | workdir='llvm')) |
| 251 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 252 | if update: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 253 | f.addStep(SVN(name='svn-clang', |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 254 | mode='update', baseURL='http://llvm.org/svn/llvm-project/cfe/', |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 255 | defaultBranch='trunk', |
| 256 | workdir='llvm/tools/clang')) |
| 257 | |
| 258 | # Full & fast clean. |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 259 | if clean: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 260 | f.addStep(ShellCommand(name='clean-1', |
| 261 | command=['del','/s/q','build'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 262 | warnOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 263 | description='cleaning', |
| 264 | descriptionDone='clean', |
| 265 | workdir='llvm')) |
| 266 | f.addStep(ShellCommand(name='clean-2', |
| 267 | command=['rmdir','/s/q','build'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 268 | warnOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 269 | description='cleaning', |
| 270 | descriptionDone='clean', |
| 271 | workdir='llvm')) |
| 272 | |
| 273 | # Create the project files. |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 274 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 275 | # Use batch files instead of ShellCommand directly, Windows quoting is |
| 276 | # borked. FIXME: See buildbot ticket #595 and buildbot ticket #377. |
| 277 | f.addStep(BatchFileDownload(name='cmakegen', |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 278 | command=[cmake, |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 279 | "-DLLVM_TARGETS_TO_BUILD:=X86", |
| 280 | "-G", |
| 281 | "Visual Studio 9 2008", |
| 282 | ".."], |
| 283 | workdir="llvm\\build")) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 284 | f.addStep(ShellCommand(name='cmake', |
| 285 | command=['cmakegen.bat'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 286 | haltOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 287 | description='cmake gen', |
| 288 | workdir='llvm\\build')) |
| 289 | |
| 290 | # Build it. |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 291 | f.addStep(BatchFileDownload(name='vcbuild', |
| 292 | command=[vcDrive + r""":\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages\vcbuild.exe""", |
| 293 | "/M%d" % jobs, |
| 294 | "LLVM.sln", |
| 295 | "Debug|Win32"], |
| 296 | workdir="llvm\\build")) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 297 | f.addStep(WarningCountingShellCommand(name='vcbuild', |
| 298 | command=['vcbuild.bat'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 299 | haltOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 300 | description='vcbuild', |
| 301 | workdir='llvm\\build', |
| 302 | warningPattern=" warning C.*:")) |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 303 | |
| 304 | # Build clang-test project. |
| 305 | f.addStep(BatchFileDownload(name='vcbuild_test', |
| 306 | command=[vcDrive + r""":\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages\vcbuild.exe""", |
| 307 | "clang-test.vcproj", |
| 308 | "Debug|Win32"], |
| 309 | workdir="llvm\\build\\tools\\clang\\test")) |
| 310 | f.addStep(ClangTestCommand(name='test-clang', |
| 311 | command=["vcbuild_test.bat"], |
| 312 | workdir="llvm\\build\\tools\\clang\\test")) |
| 313 | |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 314 | return f |