Lines Matching refs: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 == "-Weverything" {
46 } else if strings.Contains(flag, " ") {
47 args := strings.Split(flag, " ")
50 ctx.PropertyErrorf(prop, "`-include` only takes one argument: `%s`", flag)
54 ctx.PropertyErrorf(prop, "Path must not be an absolute path: %s", flag)
56 …th must not start with `../`: `%s`. Use include_dirs to -include from a different directory", flag)
58 } else if strings.HasPrefix(flag, "-D") && strings.Contains(flag, "=") {
64 … "Bad flag: `%s` is not an allowed multi-word flag. Should it be split into multiple flags?", flag)
73 for _, flag := range flags {
74 flag = strings.TrimSpace(flag)
76 if !strings.HasPrefix(flag, "-") {
77 ctx.PropertyErrorf(prop, "Flag `%s` must start with `-`", flag)
78 } else if strings.HasPrefix(flag, "-l") {
80 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use shared_libs or host_ldlibs instead", flag)
82 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use shared_libs instead", flag)
84 } else if strings.HasPrefix(flag, "-L") {
85 ctx.PropertyErrorf(prop, "Bad flag: `%s` is not allowed", flag)
86 } else if strings.HasPrefix(flag, "-Wl,--version-script") {
87 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use version_script instead", flag)
88 } else if flag == "--coverage" {
89 ctx.PropertyErrorf(prop, "Bad flag: `%s`, use native_coverage instead", flag)
90 } else if strings.Contains(flag, " ") {
91 args := strings.Split(flag, " ")
94 ctx.PropertyErrorf(prop, "`-z` only takes one argument: `%s`", flag)
97 … "Bad flag: `%s` is not an allowed multi-word flag. Should it be split into multiple flags?", flag)
111 for _, flag := range flags {
112 flag = strings.TrimSpace(flag)
115 if !strings.HasPrefix(flag, "-l") && !strings.HasPrefix(flag, "-framework") {
116 ctx.PropertyErrorf(prop, "Invalid flag: `%s`, must start with `-l` or `-framework`", flag)
117 } else if !inList(flag, allowed_ldlibs) {
118 ctx.PropertyErrorf(prop, "Host library `%s` not available", flag)
125 for _, flag := range flags {
126 flag = strings.TrimSpace(flag)
128 if !strings.HasPrefix(flag, "-") {
129 ctx.PropertyErrorf(prop, "Flag `%s` must start with `-`", flag)
130 } else if strings.HasPrefix(flag, "-fix") {
131 …op, "Flag `%s` is not allowed, since it could cause multiple writes to the same source file", flag)
132 } else if strings.HasPrefix(flag, "-checks=") {
133 ctx.PropertyErrorf(prop, "Flag `%s` is not allowed, use `tidy_checks` property instead", flag)
134 } else if strings.Contains(flag, " ") {
135 … "Bad flag: `%s` is not an allowed multi-word flag. Should it be split into multiple flags?", flag)