Meta: Update compilation flags in the GN build to match the CMake build

This commit is contained in:
Timothy Flynn 2024-06-02 15:15:54 -04:00 committed by Tim Flynn
parent 3020c5766e
commit 017009437d
Notes: sideshowbarker 2024-07-17 11:34:34 +09:00

View File

@ -79,12 +79,21 @@ config("compiler_defaults") {
# Linetables always go in the .o file, even with -gsplit-dwarf, so there's
# no point in passing -gsplit-dwarf here.
}
if (is_optimized) {
cflags += [ "-O3" ]
}
cflags += [ "-fdiagnostics-color" ]
cflags += [ "-ffp-contract=off" ]
if (is_optimized) {
cflags += [ "-O2" ]
}
cflags += [
"-D_FILE_OFFSET_BITS=64",
"-DENABLE_COMPILETIME_FORMAT_CHECK",
]
cflags += [
"-fdiagnostics-color",
"-ffp-contract=off",
"-fsigned-char",
]
if (use_lld) {
ldflags += [ "-Wl,--color-diagnostics" ]
@ -103,11 +112,14 @@ config("compiler_defaults") {
cflags += [
"-Wall",
"-Wextra",
"-Werror",
]
cflags += [
"-Wno-unused-parameter",
"-Wno-invalid-offsetof",
"-Wno-unknown-warning-option",
"-Wno-unused-parameter",
]
if (is_clang) {
cflags += [
"-Wdelete-non-virtual-dtor",
@ -116,6 +128,7 @@ config("compiler_defaults") {
"-fconstexpr-steps=16777216",
"-Wno-unused-private-field",
"-Wno-implicit-const-int-float-conversion",
"-Wno-vla-cxx-extension",
]
} else {
cflags += [
@ -166,7 +179,10 @@ config("compiler_defaults") {
"-isysroot",
rebase_path(sdk_path, root_build_dir),
]
} else {
cflags += [ "-fno-semantic-interposition" ]
}
if (sysroot != "" && current_os != "win" && is_clang) {
cflags += [ "-Wpoison-system-directories" ]
}