summaryrefslogtreecommitdiff
path: root/build_gyp/set_clang_warning_flags.gypi
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-19 11:04:01 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-19 11:04:02 -0700
commitc37b04e80aafc8437d458ced2366f825749ae2d7 (patch)
tree695828739b07bd9ede2dcfe5b84f6bfb148278de /build_gyp/set_clang_warning_flags.gypi
parenta28ae388f3859c52630deb6ef3d0ea468e5177e3 (diff)
downloadpdfium-c37b04e80aafc8437d458ced2366f825749ae2d7.tar.xz
Move build/ to build_gyp/.
This CL moves the build/ files to build_gyp/ in anticipation of pulling in Chromiums build/ directory. The gyp_pdfium files have been duplicated into both places. Once the bots are updated we'll remove the build/ versions. BUG=pdfium:106 Review URL: https://codereview.chromium.org/1900913003
Diffstat (limited to 'build_gyp/set_clang_warning_flags.gypi')
-rw-r--r--build_gyp/set_clang_warning_flags.gypi58
1 files changed, 58 insertions, 0 deletions
diff --git a/build_gyp/set_clang_warning_flags.gypi b/build_gyp/set_clang_warning_flags.gypi
new file mode 100644
index 0000000000..f6d7aea700
--- /dev/null
+++ b/build_gyp/set_clang_warning_flags.gypi
@@ -0,0 +1,58 @@
+# Copyright (c) 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is meant to be included to set clang-specific compiler flags.
+# To use this the following variable can be defined:
+# clang_warning_flags: list: Compiler flags to pass to clang.
+# clang_warning_flags_unset: list: Compiler flags to not pass to clang.
+#
+# Only use this in third-party code. In chromium_code, fix your code to not
+# warn instead!
+#
+# Note that the gypi file is included in target_defaults, so it does not need
+# to be explicitly included.
+#
+# Warning flags set by this will be used on all platforms. If you want to set
+# warning flags on only some platforms, you have to do so manually.
+#
+# To use this, create a gyp target with the following form:
+# {
+# 'target_name': 'my_target',
+# 'variables': {
+# 'clang_warning_flags': ['-Wno-awesome-warning'],
+# 'clang_warning_flags_unset': ['-Wpreviously-set-flag'],
+# }
+# }
+
+{
+ 'variables': {
+ 'clang_warning_flags_unset%': [], # Provide a default value.
+ },
+ 'conditions': [
+ ['clang==1', {
+ # This uses >@ instead of @< to also see clang_warning_flags set in
+ # targets directly, not just the clang_warning_flags in target_defaults.
+ 'cflags': [ '>@(clang_warning_flags)' ],
+ 'cflags!': [ '>@(clang_warning_flags_unset)' ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': ['>@(clang_warning_flags)'],
+ 'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'],
+ },
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'AdditionalOptions': [ '>@(clang_warning_flags)' ],
+ 'AdditionalOptions!': [ '>@(clang_warning_flags_unset)' ],
+ },
+ },
+ }],
+ ['clang==0 and host_clang==1', {
+ 'target_conditions': [
+ ['_toolset=="host"', {
+ 'cflags': [ '>@(clang_warning_flags)' ],
+ 'cflags!': [ '>@(clang_warning_flags_unset)' ],
+ }],
+ ],
+ }],
+ ],
+}