Commit 2fcc20f4 authored by Daniel Cheng's avatar Daniel Cheng

Use the Clang plugin on Windows.

BUG=467287
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/1082503002

Cr-Commit-Position: refs/heads/master@{#325465}
parent afc53166
......@@ -2148,20 +2148,31 @@
'grit_defines': ['-D', 'enable_service_discovery'],
'enable_service_discovery%': 1
}],
['clang_use_chrome_plugins==1 and OS!="win"', {
['clang_use_chrome_plugins==1', {
'variables': {
'conditions': [
['OS=="mac" or OS=="ios"', {
'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
}, { # OS != "mac" or OS != "ios"
'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
}],
['OS!="win"', {
'variables': {
'conditions': [
['OS=="mac" or OS=="ios"', {
'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
}, { # OS != "mac" or OS != "ios"
'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
}],
],
},
'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
}, { # OS == "win"
# On Windows, the plugin is built directly into clang, so there's
# no need to load it dynamically.
'clang_dynlib_flags%': '',
}]
],
},
# If you change these, also change build/config/clang/BUILD.gn.
'clang_chrome_plugins_flags%':
'-Xclang -load -Xclang <(clang_lib_path)'
' -Xclang -add-plugin -Xclang find-bad-constructs',
'<(clang_dynlib_flags)'
'-Xclang -add-plugin -Xclang find-bad-constructs',
}],
['asan==1 or msan==1 or lsan==1 or tsan==1', {
'clang%': 1,
......@@ -2214,9 +2225,9 @@
}],
['OS=="win"', {
# The Clang plugins don't currently work on Windows.
# The Blink GC plugin doesn't currently work on Windows.
# TODO(hans): One day, this will work. (crbug.com/82385)
'clang_use_chrome_plugins%': 0,
'blink_gc_plugin%': 0,
}],
# On valgrind bots, override the optimizer settings so we don't inline too
......@@ -5612,6 +5623,13 @@
],
},
}],
['clang==1 and clang_use_chrome_plugins==1', {
'VCCLCompilerTool': {
'AdditionalOptions': [
'<@(clang_chrome_plugins_flags)',
],
},
}],
],
},
},
......
......@@ -6,20 +6,29 @@ import("clang.gni")
config("find_bad_constructs") {
if (clang_use_chrome_plugins) {
cflags = [
"-Xclang",
"-load",
"-Xclang",
]
cflags = []
# On Windows, the plugin is built directly into clang, so there's
# no need to load it dynamically.
if (is_mac || is_ios) {
cflags += [ rebase_path(
"//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib",
root_build_dir) ]
cflags += [
"-Xclang",
"-load",
"-Xclang",
rebase_path(
"//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib",
root_build_dir),
]
} else if (is_linux) {
cflags += [ rebase_path(
"//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so",
root_build_dir) ]
cflags += [
"-Xclang",
"-load",
"-Xclang",
rebase_path(
"//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so",
root_build_dir),
]
}
cflags += [
......
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