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

Issue 497193002: Expand empty directories in GN to "." (Closed)

Created:
6 years, 4 months ago by brettw
Modified:
6 years, 4 months ago
Reviewers:
jamesr
CC:
chromium-reviews, feature-media-reviews_chromium.org, avayvod+watch_chromium.org, tfarina
Project:
chromium
Visibility:
Public.

Description

Expand empty directories in GN to "." When a directory substitution in a toolchain definition expands to the empty string (i.e. it's the same as the root build directory), expand the name to "." instead of the empty string to avoid corrupting filenames. For example, if you specified "{{target_out_dir}}/foo" without this it would expand to "/foo" for the default toolchain. This removes the previous special-case hack for this case. That code only worked when the entire string expanded to the filename (when the directory was at the beginning of the string). When generating command lines, the directories will be in the middle of the string and the previous special case didn't catch them. R=jamesr@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=291469

Patch Set 1 #

Patch Set 2 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -80 lines) Patch
M tools/gn/ninja_binary_target_writer_unittest.cc View 6 chunks +8 lines, -8 lines 0 comments Download
M tools/gn/substitution_writer.cc View 4 chunks +24 lines, -70 lines 1 comment Download
M tools/gn/substitution_writer_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
brettw
6 years, 4 months ago (2014-08-22 18:08:43 UTC) #1
jamesr
lgtm https://codereview.chromium.org/497193002/diff/20001/tools/gn/substitution_writer.cc File tools/gn/substitution_writer.cc (right): https://codereview.chromium.org/497193002/diff/20001/tools/gn/substitution_writer.cc#newcode22 tools/gn/substitution_writer.cc:22: // directories will end in a trailing slash). ...
6 years, 4 months ago (2014-08-22 19:04:51 UTC) #2
brettw
6 years, 4 months ago (2014-08-22 19:14:36 UTC) #3
Message was sent while issue was closed.
Committed patchset #2 manually as 291469 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698