• Michael Spang's avatar
    [Fuchsia] Clean up path usage in GN templates · 38a9d29f
    Michael Spang authored
    - Paths intererpreted by GN such as paths in inputs, sources, lib_dirs,
      etc should either be relative to BUILD.gn, or GN-absolute (relative to
      source root and start with "//").
    
      They should not be rebased as system-absolute paths; those are only
      needed for paths that are actually outside the source tree.
    
      If paths are used in multiple contexts, rebasing should be deferred
      until they are used in a context where rebased paths are required.
    
    - Paths passed as arguments to scripts should be rebased on
      root_build_dir, which is the current working directory of the build.
    
      They should not be rebased on root_out_dir, as that is only the current
      working directory for the default toolchain. Using root_out_dir in
      place of root_build_dir breaks cross compilation.
    
      They should also not be resolved to system-absolute paths, as that
      introduces an undesired dependency on the location of the source tree.
    
    - The 3rd argument to rebase_path has no effect for GN-absolute paths,
      which includes all paths built by appending to predefined variables
      such as root_out_dir.
    
    Change-Id: I54ff2d9fed0daadacf5bd1bd8fdadc561c3a2882
    Reviewed-on: https://chromium-review.googlesource.com/c/1448694
    Commit-Queue: Michael Spang <spang@chromium.org>
    Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#629579}
    38a9d29f
package.gni 5.86 KB