New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 597975 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS , Mac
Pri: 3
Type: Bug



Sign in to add a comment

GN: Add support for generating "xcode" projects to "gn gen"

Project Member Reported by sdefresne@chromium.org, Mar 25 2016

Issue description

$ gn gen --help
IDE options

  GN optionally generates files for IDE. Possibilities for <ide options>

  --ide=<ide_name>
      Generate files for an IDE. Currently supported values:
      "eclipse" - Eclipse CDT settings file.
      "vs" - Visual Studio project/solution files.
             (default Visual Studio version: 2015)
      "vs2013" - Visual Studio 2013 project/solution files.
      "vs2015" - Visual Studio 2015 project/solution files.

We should add "xcode" to this list! I have a prototype in progress, but it'll need some cleanup before being ready for production.
 
Labels: Build-Tools-GN
Cc: pinkerton@chromium.org
Summary: GN: Add support for generating "xcode" projects to "gn gen" (was: Add support for generating "xcode" projects to "gn gen")
Proof-of-concept: https://codereview.chromium.org/1827103005

The proof-of-concept CL is ugly. It hardcodes too much (assumes that all create_bundle are executables, assumes that all projects are for iOS, ...), uses too much memory (lots of strings copied, ...), duplicate too much code (need to be refactored), has no comments, ... but it allows me to build and run targets for simulator from Xcode with a project generated via "gn gen --ide=xcode".

See attached screenshot if you are interested.
7WbpF2m5VmJ.png
893 KB View Download
Cc: sdefresne@chromium.org
 Issue 593581  has been merged into this issue.
 Issue 305767  has been merged into this issue.
Project Member

Comment 5 by bugdroid1@chromium.org, May 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6ee04b5ce48981fd997b94c58240602df1a329d6

commit 6ee04b5ce48981fd997b94c58240602df1a329d6
Author: sdefresne <sdefresne@chromium.org>
Date: Tue May 03 22:20:10 2016

[GN] Add support for generating Xcode projects.

tools/gn/xcode_object.{cc,h}

  Implements a class hierarchy mimicking the structure of an Xcode
  pbxproj file with methods to dump them as text file.

tools/gn/xcode_writer.{cc,h}

  Implements generation of Xcode project structure from GN settings
  and for dumping the output to pbxproj and xcworkspacedata files.

tools/gn/*

  Add product_type field to create_bundle target. This is used when
  generating the Xcode project file to use the correct product type
  in Xcode.

  Fix a minor DCHECK failure in create_bundle_target_generator.cc.

build/config/compiler/BUILD.gn

  Remove -fdebug-prefix-map from the clang command-line as it does
  not work with Xcode (and is unnecessary as the path given to the
  compiler are relative already).

  With this flag, Xcode cannot find the source file when debbugging
  the application, without it breakpoint and displaying code work.

BUG= 597975 

Review-Url: https://codereview.chromium.org/1827103005
Cr-Commit-Position: refs/heads/master@{#391377}

[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/build/config/compiler/BUILD.gn
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/build/config/ios/rules.gni
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/BUILD.gn
[add] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/DEPS
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/bundle_data.h
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/command_gen.cc
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/commands.cc
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/commands.h
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/create_bundle_target_generator.cc
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/functions_target.cc
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/gn.gyp
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/variables.cc
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/variables.h
[modify] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/visual_studio_writer.cc
[add] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/xcode_object.cc
[add] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/xcode_object.h
[add] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/xcode_writer.cc
[add] https://crrev.com/6ee04b5ce48981fd997b94c58240602df1a329d6/tools/gn/xcode_writer.h

Project Member

Comment 6 by bugdroid1@chromium.org, May 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/27e8737ee5fbc9cf0b8a2d4a2076cd07030f7096

commit 27e8737ee5fbc9cf0b8a2d4a2076cd07030f7096
Author: sdefresne <sdefresne@chromium.org>
Date: Tue May 17 14:02:36 2016

[GN] Cleanup workaround in build/config/ios/rules.gni.

Remove workaround in build/config/ios/rules.gni now that gn has
been rolled to include support for product_type property.

BUG= 597975 

Review-Url: https://codereview.chromium.org/1948753002
Cr-Commit-Position: refs/heads/master@{#394116}

[modify] https://crrev.com/27e8737ee5fbc9cf0b8a2d4a2076cd07030f7096/build/config/ios/rules.gni

Status: Fixed (was: Started)

Sign in to add a comment