Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Issue 2057873002: [GN] Export include directories, defines and dialects to Xcode projects

Created:
4 years, 6 months ago by matt.k
Modified:
3 years, 7 months ago
Reviewers:
CC:
chromium-reviews, Dirk Pranke, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[GN] Export include directories, defines and dialects to Xcode projects Without properly specified include directories the Xcode indexer will choke and give incomplete result. Include directories and defines that apply to entire project are specified on indexer project level. Directories and defines specific to individual targets are set on file level. This together with properly specified dialect should significantly improve chances of indexer getting through all files. This patch also disables HEADERMAP which is not necessary with properly specified directories and actually confuses the indexer when there are files with same name in the project. BUG=618863 R=sdefresne@chromium.org

Patch Set 1 #

Total comments: 2

Patch Set 2 : Reformat code using git cl format #

Patch Set 3 : Use multimap for build settings #

Patch Set 4 : Add comments to PrepareBuildAttributes #

Patch Set 5 : Remove preprocessor defines on individual files #

Unified diffs Side-by-side diffs Delta from patch set Stats (+270 lines, -33 lines) Patch
M tools/gn/xcode_object.h View 1 2 5 chunks +9 lines, -4 lines 0 comments Download
M tools/gn/xcode_object.cc View 1 2 8 chunks +67 lines, -20 lines 0 comments Download
M tools/gn/xcode_writer.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tools/gn/xcode_writer.cc View 1 2 3 4 5 chunks +193 lines, -8 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
matt.k
https://codereview.chromium.org/2057873002/diff/1/tools/gn/xcode_object.cc File tools/gn/xcode_object.cc (right): https://codereview.chromium.org/2057873002/diff/1/tools/gn/xcode_object.cc#newcode239 tools/gn/xcode_object.cc:239: // split and print as vector Splitting the string ...
4 years, 6 months ago (2016-06-10 07:35:11 UTC) #1
sdefresne
Thank you for the proof-of-concept. As I said, I think that using a std::multimap<> would ...
4 years, 6 months ago (2016-06-10 08:52:34 UTC) #2
matt.k
Okay, so here are few performance related observations: 1) Specifying defines on file level is ...
4 years, 6 months ago (2016-06-11 02:38:32 UTC) #6
matt.k
I was wondering if something like this would fly declare_args() { xcode_precompiled_header = "//path/to/prefix.h" } ...
4 years, 6 months ago (2016-06-11 19:35:31 UTC) #7
sdefresne
On 2016/06/11 19:35:31, matej.knopp wrote: > I was wondering if something like this would fly ...
4 years, 6 months ago (2016-06-13 07:36:25 UTC) #8
matt.k
> I think this will not work as there can be more than one precompiled ...
4 years, 6 months ago (2016-06-13 08:31:52 UTC) #9
sdefresne
On 2016/06/13 08:31:52, matej.knopp wrote: > > I think this will not work as there ...
4 years, 6 months ago (2016-06-13 12:16:25 UTC) #10
matt.k
On 2016/06/13 12:16:25, sdefresne wrote: > On 2016/06/13 08:31:52, matej.knopp wrote: > > > I ...
4 years, 6 months ago (2016-06-13 13:42:58 UTC) #11
sdefresne
On 2016/06/13 13:42:58, matej.knopp wrote: > On 2016/06/13 12:16:25, sdefresne wrote: > > On 2016/06/13 ...
4 years, 6 months ago (2016-06-14 12:10:55 UTC) #12
matt.k
> > As you said, some of the changes are a net benefit, so can ...
4 years, 6 months ago (2016-06-14 12:30:48 UTC) #13
sdefresne
On 2016/06/14 12:30:48, matej.knopp wrote: > > > > As you said, some of the ...
4 years, 6 months ago (2016-06-14 18:05:01 UTC) #14
matt.k
> Regarding GCC_PREFIX_HEADER, brettw suggested in > https://codereview.chromium.org/2063243002/ a way to pass arbitrary arguments > ...
4 years, 6 months ago (2016-06-14 19:24:14 UTC) #15
matt.k
4 years, 5 months ago (2016-07-06 08:46:57 UTC) #16
Slightly off-topic, I made a proof of concept JSON -> XCode project generator,
which generates separate indexing target for each GN target, so all includes,
defines, precompiled headers etc can be set properly for every indexed file

https://github.com/knopp/gn-project-generators

i.e. this would create project file for GN (and its dependencies) 
gn gen --ide=json --exec-script=<path-to>/gen_xcode.py --filters="//tools/gn:gn"
\
build-xcode

It seems to work quite well, but several thousands of targets when not using any
filters in single project might be bit much for Xcode.

It relies on JSON project generator https://codereview.chromium.org/2064533002/

On 2016/06/14 19:24:14, matt.k wrote:
> > Regarding GCC_PREFIX_HEADER, brettw suggested in
> > https://codereview.chromium.org/2063243002/ a way to pass arbitrary
arguments
> > from BUILD.gn files to the IDE generator. Would this work for you?
> 
> Yes, this would definitely help.

Powered by Google App Engine
This is Rietveld 408576698