Building Google Dart from source (Mac OS X Lion + Xcode 4.2)

posted 16 Dec 2011, 08:00 by Masahiro Takatsuka   [ updated 16 Dec 2011, 08:02 ]
I've been using Google DartEditor, but it's distribution does not come with some tools.
I've decided to build everything from its source, and here is the things I had to do to build Google Dart on Mac OS X Lion with Xcode 4.2:

  • installed the latest Xcode,
  • install node.js
  • install depot_tools
    • svn co http://src.chromium.org/svn/trunk/tools/depot_tools
    • add depot_tools to my PATH in .bashrc
  • get source
gclient config http://dart.googlecode.com/svn/trunk/deps/all.deps
gclient sync
  • add the following in tools/build.py (starting at line 108)
        args = ['xcodebuild',
                '-sdk',
                'macosx10.7',
  • modify GCC_VERSION for tools/gyp/configurations_xcode.gypi as
'xcode_settings': {
          # To switch to the LLVM based backend change the two lines below.
          'GCC_VERSION': 'com.apple.compilers.llvmgcc42',
          #'GCC_VERSION': '4.2',
  • run
gclient unhooks
  • Then build (I tried with --arch=x64 but 
./tools/build.py --arch=ia32 -m release
    • I've tried with --arch=x64 but it gave me the following error..if its something unimplemented..forget it..
PhaseScriptExecution "Action \"generate_frogsh\"" /Users/masa/Documents/Dev/dart/dart/xcodebuild/dart-frog.build/Release_x64/frogsh.build/Script-095A7D91DE56B603C848FB82.sh
        cd /Users/masa/Documents/Dev/dart/dart/frog
          /bin/sh -c /Users/masa/Documents/Dev/dart/dart/xcodebuild/dart-frog.build/Release_x64/frogsh.build/Script-095A7D91DE56B603C848FB82.sh
        note: Generating frogsh file
          ./vm/code_generator_x64.h:36: error: unimplemented code
            VM exited with signal 6
            Comments