[zorg] r241147 - jenkins: Allow specifying flags more flexibly
Justin Bogner
mail at justinbogner.com
Wed Jul 1 00:38:41 PDT 2015
Author: bogner
Date: Wed Jul 1 02:38:40 2015
New Revision: 241147
URL: http://llvm.org/viewvc/llvm-project?rev=241147&view=rev
Log:
jenkins: Allow specifying flags more flexibly
Modified:
zorg/trunk/test/jenkins/test_build.py
zorg/trunk/zorg/jenkins/build.py
Modified: zorg/trunk/test/jenkins/test_build.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/test/jenkins/test_build.py?rev=241147&r1=241146&r2=241147&view=diff
==============================================================================
--- zorg/trunk/test/jenkins/test_build.py (original)
+++ zorg/trunk/test/jenkins/test_build.py Wed Jul 1 02:38:40 2015
@@ -116,15 +116,15 @@
# RUN: python %{src_root}/zorg/jenkins/build.py cmake all --lto | FileCheck --check-prefix CHECK-CMAKELTO %s
# CHECK-CMAKELTO: '/usr/local/bin/cmake' '-G' 'Ninja'
-# CHECK-CMAKELTO: '-DCMAKE_C_FLAGS=-flto' '-DCMAKE_CXX_FLAGS=-flto'
# CHECK-CMAKELTO: '-DLLVM_BUILD_EXAMPLES=Off'
+# CHECK-CMAKELTO: '-DCMAKE_C_FLAGS=-flto' '-DCMAKE_CXX_FLAGS=-flto'
# CHECK-CMAKELTO: '-DLLVM_PARALLEL_LINK_JOBS=1'
# CHECK-CMAKELTO: '-DCMAKE_BUILD_TYPE=Release'
# RUN: env MAX_PARALLEL_LINKS=2 python %{src_root}/zorg/jenkins/build.py cmake all --lto | FileCheck --check-prefix CHECK-CMAKE-PAR-LTO %s
# CHECK-CMAKE-PAR-LTO: '/usr/local/bin/cmake' '-G' 'Ninja'
-# CHECK-CMAKE-PAR-LTO: '-DCMAKE_C_FLAGS=-flto' '-DCMAKE_CXX_FLAGS=-flto'
# CHECK-CMAKE-PAR-LTO: '-DLLVM_BUILD_EXAMPLES=Off'
+# CHECK-CMAKE-PAR-LTO: '-DCMAKE_C_FLAGS=-flto' '-DCMAKE_CXX_FLAGS=-flto'
# CHECK-CMAKE-PAR-LTO: '-DLLVM_PARALLEL_LINK_JOBS=2'
# CHECK-CMAKE-PAR-LTO: '-DCMAKE_BUILD_TYPE=Release'
Modified: zorg/trunk/zorg/jenkins/build.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/build.py?rev=241147&r1=241146&r2=241147&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/build.py (original)
+++ zorg/trunk/zorg/jenkins/build.py Wed Jul 1 02:38:40 2015
@@ -121,15 +121,20 @@ def cmake_builder(target):
"-DCMAKE_INSTALL_PREFIX=" + conf.installdir(),
conf.srcdir()]
+ compiler_flags = conf.compiler_flags
max_parallel_links = conf.max_parallel_links
if conf.lto:
- cmake_cmd += ["-DCMAKE_C_FLAGS=-flto", "-DCMAKE_CXX_FLAGS=-flto"]
+ compiler_flags += ['-flto']
cmake_cmd += ['-DLLVM_BUILD_EXAMPLES=Off']
if not max_parallel_links:
max_parallel_links = 1
else:
cmake_cmd += ['-DLLVM_BUILD_EXAMPLES=On']
+ if compiler_flags:
+ cmake_cmd += ["-DCMAKE_C_FLAGS={}".format(' '.join(compiler_flags)),
+ "-DCMAKE_CXX_FLAGS={}".format(' '.join(compiler_flags))]
+
if max_parallel_links is not None:
cmake_cmd += ["-DLLVM_PARALLEL_LINK_JOBS={}".format(max_parallel_links)]
@@ -144,6 +149,9 @@ def cmake_builder(target):
else:
cmake_cmd += ["-DCMAKE_BUILD_TYPE=Release"]
+ for flag in conf.cmake_flags:
+ cmake_cmd += flag
+
if conf.assertions:
cmake_cmd += ["-DLLVM_ENABLE_ASSERTIONS=On"]
else:
@@ -185,8 +193,13 @@ def clang_builder(target):
else:
configure_cmd.append("--disable-assertions")
+ compiler_flags = conf.compiler_flags
if conf.lto:
- configure_cmd.extend(['--with-extra-options=-flto -gline-tables-only'])
+ compiler_flags += ['-flto', '-gline-tables-only']
+
+ if compiler_flags:
+ configure_cmd.extend(
+ ['--with-extra-options={}'.format(' '.join(compiler_flags))])
configure_cmd.extend(["--enable-optimized",
"--disable-bindings", "--enable-targets=x86,x86_64,arm,aarch64",
@@ -497,6 +510,12 @@ def parse_args():
parser.add_argument('--cmake-type', dest='cmake_build_type',
help="Override cmake type Release, Debug, "
"RelWithDebInfo and MinSizeRel")
+ parser.add_argument('--cmake-flag', dest='cmake_flags',
+ action='append', default=[],
+ help='Set an arbitrary cmake flag')
+ parser.add_argument('--compiler-flag', dest='compiler_flags',
+ action='append', default=[],
+ help='Set an arbitrary compiler flag')
args = parser.parse_args()
return args
More information about the llvm-commits
mailing list