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