Skip to content

Commit

Permalink
Make the allocator_features gyp target target-only
Browse files Browse the repository at this point in the history
allocator_features uses buildflag_header to generate a header at
build time. In host/target builds, both the #host and #target
targets have a ninja rule for the same path, which is bad.
This CL makes allocator_features follow the same pattern of
base_debugging_flags (target-only, everything else explicitly refers
to the #target veriant)

I verified that the problem reproduces without this patch
by doing:
$ build/gyp_chromium -DOS=android -Duse_experimental_allocator_shim=1
$ ninja -w dupbuild=err -n -C out_android/Release/ all
ninja: warning: multiple rules generate gen/base/allocator/features.h. builds involving this target will not be correct;

And this CL fixes it.

BUG=593695

Review URL: https://codereview.chromium.org/1794943006

Cr-Commit-Position: refs/heads/master@{#381289}
  • Loading branch information
primiano authored and Commit bot committed Mar 15, 2016
1 parent cc9b0c5 commit d19a104
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion base/allocator/allocator.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,10 @@
}, # 'allocator' target.
{
# GN: //base/allocator:features
# When referenced from a target that might be compiled in the host
# toolchain, always refer to 'allocator_features#target'.
'target_name': 'allocator_features',
'includes': [ '../../build/buildflag_header.gypi' ],
'toolsets': ['host', 'target'],
'variables': {
'buildflag_header_path': 'base/allocator/features.h',
'buildflag_flags': [
Expand Down
2 changes: 1 addition & 1 deletion base/base.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
'dependencies': [
'allocator/allocator.gyp:allocator',
'allocator/allocator.gyp:allocator_features',
'allocator/allocator.gyp:allocator_features#target',
'base_debugging_flags#target',
'base_static',
'base_build_date#target',
Expand Down

0 comments on commit d19a104

Please sign in to comment.