Commit 573da77f authored by Nico Weber's avatar Nico Weber

win: Don't build /FORCE:DuplicateRes targets with /WX.

/FORCE:MultipleRes makes duplicate resources emit a warning instead of
an error, but /WX converts all warnings into errors.

TBR=hans

Bug: 958955
Change-Id: I0764edbcd9f13f7412e160075985ce611675dc4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594701
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656390}
parent 01aceb84
......@@ -432,6 +432,7 @@ default_compiler_configs = [
"//build/config/compiler:default_stack_frames",
"//build/config/compiler:default_symbols",
"//build/config/compiler:export_dynamic",
"//build/config/compiler:fatal_linker_warnings_win",
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
"//build/config/compiler:runtime_library",
......
......@@ -1085,7 +1085,8 @@ config("compiler_deterministic") {
}
# Makes builds independent of absolute file path.
if (symbol_level != 0 && is_clang && strip_absolute_paths_from_debug_symbols) {
if (symbol_level != 0 && is_clang &&
strip_absolute_paths_from_debug_symbols) {
# If debug option is given, clang includes $cwd in debug info by default.
# For such build, this flag generates reproducible obj files even we use
# different build directory like "out/feature_a" and "out/feature_b" if
......@@ -1173,7 +1174,8 @@ config("compiler_arm") {
config("assembler_debug_dir") {
# TODO(thakis): Once openmax_dl no longer uses -fno-integrated-as, move
# this behind the -fdebug-compilation-dir cflags in the "compiler" config.
if (symbol_level != 0 && is_clang && strip_absolute_paths_from_debug_symbols) {
if (symbol_level != 0 && is_clang &&
strip_absolute_paths_from_debug_symbols) {
if (!is_win) {
# We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
......@@ -1242,9 +1244,6 @@ config("default_warnings") {
if (treat_warnings_as_errors) {
cflags += [ "/WX" ]
}
if (fatal_linker_warnings) {
ldflags += [ "/WX" ]
}
cflags += [
# Warnings permanently disabled:
......@@ -1509,6 +1508,14 @@ config("default_warnings") {
}
}
config("fatal_linker_warnings_win") {
# TODO(thakis): Move this back into default_warnings once
# https://crbug.com/958955 is resolved.
if (is_win && fatal_linker_warnings) {
ldflags = [ "/WX" ]
}
}
# chromium_code ---------------------------------------------------------------
#
# Toggles between higher and lower warnings for code that is (or isn't)
......
......@@ -55,5 +55,6 @@ test("gcp_unittests") {
if (is_win && llvm_force_head_revision) {
# TODO(https://crbug.com/958955): Fix dupes and remove this flag.
ldflags = [ "/FORCE:MultipleRes" ]
configs -= [ "//build/config/compiler:fatal_linker_warnings_win" ]
}
}
......@@ -4552,6 +4552,7 @@ test("unit_tests") {
if (llvm_force_head_revision) {
# TODO(https://crbug.com/958955): Fix dupes and remove this flag.
ldflags += [ "/FORCE:MultipleRes" ]
configs -= [ "//build/config/compiler:fatal_linker_warnings_win" ]
}
if (is_chrome_branded) {
......@@ -5779,6 +5780,7 @@ if (!is_android && !is_fuchsia) {
if (llvm_force_head_revision) {
# TODO(https://crbug.com/958955): Fix dupes and remove this flag.
ldflags = [ "/FORCE:MultipleRes" ]
configs -= [ "//build/config/compiler:fatal_linker_warnings_win" ]
}
} else {
sources -= [ "../app/chrome_version.rc.version" ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment