Use Path instead of string for file paths

This centralizes verification and common operations, like converting the
path to a source file to the path for a built object.

It also embeds the configuration knowledge into the path, so that we can
remove "${SrcDir}/path" from the ninja file. When SrcDir is '.', that
leads to paths like './path' instead of just 'path' like make is doing,
causing differences in compiled binaries.

Change-Id: Ib4e8910a6e867ce1b7b420d927c04f1142a7589e
This commit is contained in:
Dan Willemsen
2015-09-23 15:26:20 -07:00
parent fafa3dc7e2
commit 34cc69e4bf
30 changed files with 1430 additions and 763 deletions

View File

@@ -24,12 +24,12 @@ import (
// Efficiently converts a list of include directories to a single string
// of cflags with -I prepended to each directory.
func includeDirsToFlags(dirs []string) string {
return common.JoinWithPrefix(dirs, "-I")
func includeDirsToFlags(dirs common.Paths) string {
return common.JoinWithPrefix(dirs.Strings(), "-I")
}
func includeFilesToFlags(dirs []string) string {
return common.JoinWithPrefix(dirs, "-include ")
func includeFilesToFlags(files common.Paths) string {
return common.JoinWithPrefix(files.Strings(), "-include ")
}
func ldDirsToFlags(dirs []string) string {