Skip to content

Commit

Permalink
pw_build: Add -O and -g flags to rustflags
Browse files Browse the repository at this point in the history
-O and -g flags specified through GN toolchains were missing from
rustflags.

Change-Id: Ifb3aa5c2967fe4b717de72f1a8ca7b9d0d40313e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236392
Reviewed-by: Erik Gilling <[email protected]>
Docs-Not-Needed: Jiacheng Lu <[email protected]>
Commit-Queue: Jiacheng Lu <[email protected]>
Lint: Lint 🤖 <[email protected]>
  • Loading branch information
Jason0214 authored and CQ Bot Account committed Sep 26, 2024
1 parent 1f2a0fe commit 07636c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pw_build/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,38 +43,38 @@ config("colorize_output") {
config("debugging") {
# Enable debug symbol generation. This has no effect on final code size.
cflags = [ "-g" ]
rustflags = [ "-Clink-arg=-g" ]
rustflags = cflags + [ "-Clink-arg=-g" ]
}

config("extra_debugging") {
# Include things like macro expansion in debug info.
cflags = [ "-g3" ]
rustflags = [ "-Clink-arg=-g3" ]
rustflags = cflags + [ "-Clink-arg=-g3" ]
}

# Optimization levels
config("optimize_debugging") {
cflags = [ "-Og" ]
ldflags = cflags
rustflags = [ "-Clink-arg=-Og" ]
rustflags = cflags + [ "-Clink-arg=-Og" ]
}

config("optimize_speed") {
cflags = [ "-O2" ]
ldflags = cflags
rustflags = [ "-Clink-arg=-O2" ]
rustflags = cflags + [ "-Clink-arg=-O2" ]
}

config("optimize_more_speed") {
cflags = [ "-O3" ]
ldflags = cflags
rustflags = [ "-Clink-arg=-O3" ]
rustflags = cflags + [ "-Clink-arg=-O3" ]
}

config("optimize_size") {
cflags = [ "-Os" ]
ldflags = cflags
rustflags = [ "-Clink-arg=-Os" ]
rustflags = cflags + [ "-Clink-arg=-Os" ]
}

config("enable_clang_fixed_point_types") {
Expand Down

0 comments on commit 07636c2

Please sign in to comment.