summaryrefslogtreecommitdiff
path: root/buildbot
diff options
context:
space:
mode:
authorbungeman@chromium.org <bungeman@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af>2013-11-20 22:31:17 +0000
committerbungeman@chromium.org <bungeman@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af>2013-11-20 22:31:17 +0000
commitd0176c0a2a9e558662905c328c3aa93fd25bbf12 (patch)
treefb4294f47a53cf6b3dc579fa7b61350ab6655f8f /buildbot
parent34b060532e7753b3de7d33e9d330a8cd0179b5cb (diff)
downloadgyp-d0176c0a2a9e558662905c328c3aa93fd25bbf12.tar.gz
CMake generator.
Designed to create projects for IDEs like kdevelop, qtcreator, code::blocks, or eclipse cdt. Generated CMakeLists.txt can also be used to build (currently limited to *nix). Requires CMake 2.8.8 or later. With patch set 9 (which builds CMake 2.8.8 on the bot) passes tests on the bots. R=thakis@chromium.org Review URL: https://codereview.chromium.org/12314014 git-svn-id: http://gyp.googlecode.com/svn/trunk@1796 78cadc50-ecff-11dd-a971-7dbc132099af
Diffstat (limited to 'buildbot')
-rwxr-xr-xbuildbot/buildbot_run.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/buildbot/buildbot_run.py b/buildbot/buildbot_run.py
index 398eb87a..979073c7 100755
--- a/buildbot/buildbot_run.py
+++ b/buildbot/buildbot_run.py
@@ -23,6 +23,8 @@ BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
ROOT_DIR = os.path.dirname(TRUNK_DIR)
ANDROID_DIR = os.path.join(ROOT_DIR, 'android')
+CMAKE_DIR = os.path.join(ROOT_DIR, 'cmake')
+CMAKE_BIN_DIR = os.path.join(CMAKE_DIR, 'bin')
OUT_DIR = os.path.join(TRUNK_DIR, 'out')
@@ -34,6 +36,43 @@ def CallSubProcess(*args, **kwargs):
sys.exit(1)
+def PrepareCmake():
+ """Build CMake 2.8.8 since the version in Precise is 2.8.7."""
+ if os.environ['BUILDBOT_CLOBBER'] == '1':
+ print '@@@BUILD_STEP Clobber CMake checkout@@@'
+ shutil.rmtree(CMAKE_DIR)
+
+ # We always build CMake 2.8.8, so no need to do anything
+ # if the directory already exists.
+ if os.path.isdir(CMAKE_DIR):
+ return
+
+ print '@@@BUILD_STEP Initialize CMake checkout@@@'
+ os.mkdir(CMAKE_DIR)
+ CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
+ CallSubProcess(['git', 'config', '--global',
+ 'user.email', 'chrome-bot@google.com'])
+ CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
+
+ print '@@@BUILD_STEP Sync CMake@@@'
+ CallSubProcess(
+ ['git', 'clone',
+ '--depth', '1',
+ '--single-branch',
+ '--branch', 'v2.8.8',
+ '--',
+ 'git://cmake.org/cmake.git',
+ CMAKE_DIR],
+ cwd=CMAKE_DIR)
+
+ print '@@@BUILD_STEP Build CMake@@@'
+ CallSubProcess(
+ ['/bin/bash', 'bootstrap', '--prefix=%s' % CMAKE_DIR],
+ cwd=CMAKE_DIR)
+
+ CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR)
+
+
def PrepareAndroidTree():
"""Prepare an Android tree to run 'android' format tests."""
if os.environ['BUILDBOT_CLOBBER'] == '1':
@@ -91,6 +130,7 @@ def GypTestFormat(title, format=None, msvs_version=None):
'--all',
'--passed',
'--format', format,
+ '--path', CMAKE_BIN_DIR,
'--chdir', 'trunk'])
if format == 'android':
# gyptest needs the environment setup from envsetup/lunch in order to build
@@ -124,6 +164,8 @@ def GypBuild():
elif sys.platform.startswith('linux'):
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('make')
+ PrepareCmake()
+ retcode += GypTestFormat('cmake')
elif sys.platform == 'darwin':
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('xcode')