Merge "Add rust default compilation flags."
This commit is contained in:
commit
0aa51a018b
2 changed files with 7 additions and 0 deletions
|
@ -44,6 +44,8 @@ func init() {
|
||||||
|
|
||||||
func TransformSrcToBinary(ctx android.ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
func TransformSrcToBinary(ctx android.ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
||||||
outputFile android.WritablePath, includeDirs []string) {
|
outputFile android.WritablePath, includeDirs []string) {
|
||||||
|
flags.RustFlags = append(flags.RustFlags, "-C lto")
|
||||||
|
|
||||||
transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "bin", includeDirs)
|
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,
|
func TransformSrctoStatic(ctx android.ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
||||||
outputFile android.WritablePath, includeDirs []string) {
|
outputFile android.WritablePath, includeDirs []string) {
|
||||||
|
flags.RustFlags = append(flags.RustFlags, "-C lto")
|
||||||
transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "staticlib", includeDirs)
|
transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "staticlib", includeDirs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TransformSrctoShared(ctx android.ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
func TransformSrctoShared(ctx android.ModuleContext, mainSrc android.Path, deps PathDeps, flags Flags,
|
||||||
outputFile android.WritablePath, includeDirs []string) {
|
outputFile android.WritablePath, includeDirs []string) {
|
||||||
|
flags.RustFlags = append(flags.RustFlags, "-C lto")
|
||||||
transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "cdylib", includeDirs)
|
transformSrctoCrate(ctx, mainSrc, deps, flags, outputFile, "cdylib", includeDirs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,9 @@ var (
|
||||||
|
|
||||||
GlobalRustFlags = []string{
|
GlobalRustFlags = []string{
|
||||||
"--remap-path-prefix $$(pwd)=",
|
"--remap-path-prefix $$(pwd)=",
|
||||||
|
"-C codegen-units=1",
|
||||||
|
"-C opt-level=3",
|
||||||
|
"-C relocation-model=pic",
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceGlobalRustFlags = []string{}
|
deviceGlobalRustFlags = []string{}
|
||||||
|
|
Loading…
Reference in a new issue