diff options
author | Oliver Chang <ochang@chromium.org> | 2015-10-21 15:29:47 -0700 |
---|---|---|
committer | Oliver Chang <ochang@chromium.org> | 2015-10-21 15:29:47 -0700 |
commit | afaa98eeb161d60e76506a16d8b986203a7ec0b3 (patch) | |
tree | 3f6252ee9716c09eb8cbca6f64c6d42798bc21a1 /build | |
parent | 5a21e14fb699453fe9d0c7bd0de12c434b102938 (diff) | |
download | pdfium-afaa98eeb161d60e76506a16d8b986203a7ec0b3.tar.xz |
Merge to XFA: (Reland) Switch builds to clang by default for Linux and OS X.
Also adds support for ASan and sanitizer coverage.
BUG=pdfium:1,pdfium:171
R=thestig@chromium.org
Committed: https://pdfium.googlesource.com/pdfium/+/5478df43a8970257e9644ae6f57a6fe7513029c6
Review URL: https://codereview.chromium.org/1406843002 .
(cherry picked from commit 3b2ab45f0a883046a7c457e8435b5a9b2c1c4156)
Review URL: https://codereview.chromium.org/1412193010 .
Diffstat (limited to 'build')
-rw-r--r-- | build/standalone.gypi | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/build/standalone.gypi b/build/standalone.gypi index 507368dc25..a70b442bee 100644 --- a/build/standalone.gypi +++ b/build/standalone.gypi @@ -8,6 +8,8 @@ 'variables': { 'component%': 'static_library', 'clang%': 0, + 'asan%': 0, + 'sanitizer_coverage%': 0, 'msvs_multi_core_compile%': '1', 'variables': { 'variables': { @@ -37,6 +39,7 @@ 'host_arch%': '<(host_arch)', 'target_arch%': '<(target_arch)', }, + 'clang_dir%': 'third_party/llvm-build/Release+Asserts', # These two are needed by V8. 'host_arch%': '<(host_arch)', 'target_arch%': '<(target_arch)', @@ -50,6 +53,11 @@ }, { 'os_posix%': 1, }], + ['OS=="linux" or OS=="mac"', { + 'clang%': 1, + }, { + 'clang%': 0, + }], ], }, 'target_defaults': { @@ -249,6 +257,20 @@ '-fPIC', ], }], + ['asan==1', { + 'cflags': [ + '-fsanitize=address', + '-gline-tables-only', + ], + 'ldflags': [ + '-fsanitize=address', + ], + }], + ['sanitizer_coverage!=0', { + 'cflags': [ + '-fsanitize-coverage=<(sanitizer_coverage)', + ], + }], ['OS=="win"', { 'defines': [ 'NOMINMAX', @@ -280,5 +302,17 @@ 'xcode_settings': { # See comment in Chromium's common.gypi for why this is needed. 'SYMROOT': '<(DEPTH)/xcodebuild', - } + }, + 'conditions': [ + ['OS=="linux" or OS=="mac"', { + 'conditions': [ + ['clang==1', { + 'make_global_settings': [ + ['CC', '<(clang_dir)/bin/clang'], + ['CXX', '<(clang_dir)/bin/clang++'], + ], + }], + ], + }], # OS=="linux" or OS=="mac" + ], } |