I have spent about 30 mins trying to build Google Dart. The problem is in macosx sdk version. Google Dart needs 10.5 for building, but there is no 10.5 sdk in XCode 4 in Lion.
Error message:
=== BUILD NATIVE TARGET v8_base OF PROJECT v8 WITH CONFIGURATION Debug_x64 === ** BUILD FAILED **
Full instruction how to build Google Dart and fix this issue:
0. Install depot_tools
First of all, we need depot_tools from google:
http://dev.chromium.org/developers/how-tos/install-depot-tools
svn co http://src.chromium.org/svn/trunk/tools/depot_tools export PATH="$PATH":`pwd`/depot_tools
1. Getting the source
How to get the source: http://code.google.com/p/dart/wiki/GettingTheSource
gclient config http://dart.googlecode.com/svn/trunk/deps/all.deps gclient sync
2. Change Mac OS X SDK to 10.6
Open tools/build.py and add the following lines after line 108:
'-sdk', 'macosx10.6',
Now build.py 108-119 lines should look like:
args = ['xcodebuild',
'-sdk',
'macosx10.6',
'-project',
project_file,
'-target',
target,
'-parallelizeTargets',
'-configuration',
build_config,
'SYMROOT=%s' % os.path.abspath('xcodebuild')
]
Diff:
Index: tools/build.py
===================================================================
--- tools/build.py (revision 296)
+++ tools/build.py (working copy)
@@ -106,6 +106,8 @@
if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()):
project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName()
args = ['xcodebuild',
+ '-sdk',
+ 'macosx10.6',
'-project',
project_file,
'-target',
3. Building everything
Next step is described in Google guide:
http://code.google.com/p/dart/wiki/Building#Building_everything
Just run
./tools/build.py --arch=ia32
or
./tools/build.py --arch=x64
That’s all.

