Lines Matching full:flag

30 	for _, flag := range flags {
31 flag = strings.TrimSpace(flag)
33 if !strings.HasPrefix(flag, "-") {
34 ctx.PropertyErrorf(prop, "Flag `%s` must start with `-`", flag)
35 } else if strings.HasPrefix(flag, "-I") || strings.HasPrefix(flag, "-isystem") {
36 ctx.PropertyErrorf(prop, "Bad flag `%s`, use local_include_dirs or include_dirs instead", flag)
37 } else if inList(flag, config.IllegalFlags) {
38 ctx.PropertyErrorf(prop, "Illegal flag `%s`", flag)
39 } else if flag == "--coverage" {
40 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use native_coverage instead", flag)
41 } else if flag == "-fwhole-program-vtables" {
42 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use whole_program_vtables instead", flag)
43 } else if flag == "-gsplit-dwarf" {
44 …ctx.PropertyErrorf(prop, "Bad flag: `%s`, soong cannot track dependencies to split dwarf debuginfo…
45 } else if flag == "-fno-integrated-as" {
46 …ctx.PropertyErrorf("Bad flag: `%s` is disallowed as it may invoke the `as` from the build host", f…
47 } else if flag == "-Weverything" {
52 } else if strings.HasPrefix(flag, "-target ") || strings.HasPrefix(flag, "--target ") ||
53 strings.HasPrefix(flag, "-target=") || strings.HasPrefix(flag, "--target=") {
54 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use the correct target soong rule.", flag)
55 } else if strings.Contains(flag, " ") {
56 args := strings.Split(flag, " ")
59 ctx.PropertyErrorf(prop, "`-include` only takes one argument: `%s`", flag)
63 ctx.PropertyErrorf(prop, "Path must not be an absolute path: %s", flag)
65 …th must not start with `../`: `%s`. Use include_dirs to -include from a different directory", flag)
69 ctx.PropertyErrorf(prop, "`-mllvm` only takes one argument: `%s`", flag)
73 ctx.PropertyErrorf(prop, "`-Xclang` only takes one argument: `%s`", flag)
75 } else if strings.HasPrefix(flag, "-D") && strings.Contains(flag, "=") {
79 // correctly to prevent multi flag cases like -DNAME=value -O2.
81 …ctx.PropertyErrorf(prop, "Bad flag: `%s` is not an allowed multi-word flag. Should it be split int…
90 for _, flag := range flags {
91 flag = strings.TrimSpace(flag)
93 if !strings.HasPrefix(flag, "-") {
94 ctx.PropertyErrorf(prop, "Flag `%s` must start with `-`", flag)
95 } else if strings.HasPrefix(flag, "-l") {
97 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use shared_libs or host_ldlibs instead", flag)
99 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use shared_libs instead", flag)
101 } else if strings.HasPrefix(flag, "-L") {
102 ctx.PropertyErrorf(prop, "Bad flag: `%s` is not allowed", flag)
103 } else if strings.HasPrefix(flag, "-Wl,--version-script") {
104 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use version_script instead", flag)
105 } else if flag == "-T" || strings.HasPrefix(flag, "--script") {
106 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use linker_scripts instead", flag)
107 } else if flag == "--coverage" {
108 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use native_coverage instead", flag)
109 } else if strings.Contains(flag, " ") {
110 args := strings.Split(flag, " ")
113 ctx.PropertyErrorf(prop, "`-z` only takes one argument: `%s`", flag)
116 …ctx.PropertyErrorf(prop, "Bad flag: `%s` is not an allowed multi-word flag. Should it be split int…
130 for _, flag := range flags {
131 flag = strings.TrimSpace(flag)
134 if !strings.HasPrefix(flag, "-l") && !strings.HasPrefix(flag, "-framework") {
135 ctx.PropertyErrorf(prop, "Invalid flag: `%s`, must start with `-l` or `-framework`", flag)
136 } else if !inList(flag, allowedLdlibs) {
137 ctx.PropertyErrorf(prop, "Host library `%s` not available", flag)
144 for _, flag := range flags {
145 flag = strings.TrimSpace(flag)
147 if !strings.HasPrefix(flag, "-") {
148 ctx.PropertyErrorf(prop, "Flag `%s` must start with `-`", flag)
149 } else if strings.HasPrefix(flag, "-fix") {
150 …ctx.PropertyErrorf(prop, "Flag `%s` is not allowed, since it could cause multiple writes to the sa…
151 } else if strings.HasPrefix(flag, "-checks=") {
152 ctx.PropertyErrorf(prop, "Flag `%s` is not allowed, use `tidy_checks` property instead", flag)
153 } else if strings.Contains(flag, " ") {
154 …ctx.PropertyErrorf(prop, "Bad flag: `%s` is not an allowed multi-word flag. Should it be split int…