bp2build implementation for c_std
Test: mixed_droid in conjunction with topic changes Change-Id: Ic673c1b269f5082b490b32057eb60f3b73eb0940
This commit is contained in:
@@ -304,11 +304,24 @@ func parseCppStd(cppStdPtr *string) string {
|
||||
cppStd := String(cppStdPtr)
|
||||
switch cppStd {
|
||||
case "":
|
||||
cppStd = config.CppStdVersion
|
||||
return config.CppStdVersion
|
||||
case "experimental":
|
||||
cppStd = config.ExperimentalCppStdVersion
|
||||
return config.ExperimentalCppStdVersion
|
||||
default:
|
||||
return cppStd
|
||||
}
|
||||
}
|
||||
|
||||
func parseCStd(cStdPtr *string) string {
|
||||
cStd := String(cStdPtr)
|
||||
switch cStd {
|
||||
case "":
|
||||
return config.CStdVersion
|
||||
case "experimental":
|
||||
return config.ExperimentalCStdVersion
|
||||
default:
|
||||
return cStd
|
||||
}
|
||||
return cppStd
|
||||
}
|
||||
|
||||
// Create a Flags struct that collects the compile flags from global values,
|
||||
@@ -479,13 +492,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
||||
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags, tc.ToolchainCflags())
|
||||
|
||||
cStd := config.CStdVersion
|
||||
if String(compiler.Properties.C_std) == "experimental" {
|
||||
cStd = config.ExperimentalCStdVersion
|
||||
} else if String(compiler.Properties.C_std) != "" {
|
||||
cStd = String(compiler.Properties.C_std)
|
||||
}
|
||||
|
||||
cStd := parseCStd(compiler.Properties.C_std)
|
||||
cppStd := parseCppStd(compiler.Properties.Cpp_std)
|
||||
|
||||
cStd, cppStd = maybeReplaceGnuToC(compiler.Properties.Gnu_extensions, cStd, cppStd)
|
||||
|
Reference in New Issue
Block a user