Merge "Add rust default compilation flags."
This commit is contained in:
commit
0aa51a018b
|
@ -44,6 +44,8 @@ func init() {
|
|||
|
||||
func TransformSrcToBinary(ctx android.ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
||||
outputFile android.WritablePath, includeDirs []string) {
|
||||
flags.RustFlags = append(flags.RustFlags, "-C lto")
|
||||
|
||||
transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "bin", includeDirs)
|
||||
}
|
||||
|
||||
|
@ -59,11 +61,13 @@ func TransformSrctoDylib(ctx android.ModuleContext, mainSrc android.Path, deps P
|
|||
|
||||
func TransformSrctoStatic(ctx android.ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
||||
outputFile android.WritablePath, includeDirs []string) {
|
||||
flags.RustFlags = append(flags.RustFlags, "-C lto")
|
||||
transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "staticlib", includeDirs)
|
||||
}
|
||||
|
||||
func TransformSrctoShared(ctx android.ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
||||
outputFile android.WritablePath, includeDirs []string) {
|
||||
flags.RustFlags = append(flags.RustFlags, "-C lto")
|
||||
transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "cdylib", includeDirs)
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,9 @@ var (
|
|||
|
||||
GlobalRustFlags = []string{
|
||||
"--remap-path-prefix $$(pwd)=",
|
||||
"-C codegen-units=1",
|
||||
"-C opt-level=3",
|
||||
"-C relocation-model=pic",
|
||||
}
|
||||
|
||||
deviceGlobalRustFlags = []string{}
|
||||
|
|
Loading…
Reference in New Issue