abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1 | # Copyright 2016 Google Inc. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
mtklein | f037d48 | 2016-07-19 08:25:00 -0700 | [diff] [blame] | 6 | template("third_party") { |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 7 | config(target_name + "_public") { |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 8 | if (defined(invoker.public_defines)) { |
| 9 | defines = invoker.public_defines |
| 10 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 11 | include_dirs = invoker.public_include_dirs |
| 12 | } |
mtklein | f037d48 | 2016-07-19 08:25:00 -0700 | [diff] [blame] | 13 | source_set(target_name) { |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 14 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
| 15 | public_configs = [ ":" + target_name + "_public" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 16 | |
mtklein | f037d48 | 2016-07-19 08:25:00 -0700 | [diff] [blame] | 17 | # Warnings are just noise if we're not maintaining the code. |
herb | b6318bf | 2016-09-16 13:29:57 -0700 | [diff] [blame] | 18 | if (is_win) { |
| 19 | cflags = [ "/w" ] |
| 20 | } else { |
| 21 | cflags = [ "-w" ] |
| 22 | } |
mtklein | f037d48 | 2016-07-19 08:25:00 -0700 | [diff] [blame] | 23 | } |
| 24 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 25 | |
| 26 | set_defaults("third_party") { |
Mike Klein | c7165c2 | 2016-10-12 23:58:06 -0400 | [diff] [blame] | 27 | configs = default_configs - [ "//gn:warnings" ] |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 28 | } |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 29 | |
| 30 | template("system") { |
| 31 | config(target_name + "_public") { |
| 32 | forward_variables_from(invoker, "*", []) |
| 33 | } |
| 34 | group(target_name) { |
| 35 | public_configs = [ ":" + target_name + "_public" ] |
| 36 | } |
| 37 | } |