blob: 7aaf63586f8e8da6436917de5cb309b26a8c16dd [file] [log] [blame]
abarth6fc8ff02016-07-15 15:15:15 -07001# 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
mtkleinf037d482016-07-19 08:25:00 -07006template("third_party") {
mtklein25c81d42016-07-27 13:55:26 -07007 config(target_name + "_public") {
Mike Klein4b167fc2016-10-11 18:13:53 -04008 if (defined(invoker.public_defines)) {
9 defines = invoker.public_defines
10 }
mtklein25c81d42016-07-27 13:55:26 -070011 include_dirs = invoker.public_include_dirs
12 }
mtkleinf037d482016-07-19 08:25:00 -070013 source_set(target_name) {
mtklein25c81d42016-07-27 13:55:26 -070014 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
15 public_configs = [ ":" + target_name + "_public" ]
abarth6fc8ff02016-07-15 15:15:15 -070016
mtkleinf037d482016-07-19 08:25:00 -070017 # Warnings are just noise if we're not maintaining the code.
herbb6318bf2016-09-16 13:29:57 -070018 if (is_win) {
19 cflags = [ "/w" ]
20 } else {
21 cflags = [ "-w" ]
22 }
mtkleinf037d482016-07-19 08:25:00 -070023 }
24}
halcanary19a97202016-08-03 15:08:04 -070025
26set_defaults("third_party") {
Mike Kleinc7165c22016-10-12 23:58:06 -040027 configs = default_configs - [ "//gn:warnings" ]
halcanary19a97202016-08-03 15:08:04 -070028}
Mike Klein10d665d2016-11-01 11:46:10 -040029
30template("system") {
31 config(target_name + "_public") {
32 forward_variables_from(invoker, "*", [])
33 }
34 group(target_name) {
35 public_configs = [ ":" + target_name + "_public" ]
36 }
37}