| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
| 6 import("//build/config/linux/pkg_config.gni") | 6 import("//build/config/linux/pkg_config.gni") |
| 7 import("//build/config/ui.gni") |
| 7 | 8 |
| 8 # CrOS doesn't install GTK, gconf or any gnome packages. | 9 # CrOS doesn't install GTK, gconf or any gnome packages. |
| 9 assert(!is_chromeos) | 10 assert(!is_chromeos) |
| 10 | 11 |
| 11 # These packages should _only_ be expected when building for a target. | 12 # These packages should _only_ be expected when building for a target. |
| 12 # If these extra checks are not run, gconf is required when building host | 13 # If these extra checks are not run, gconf is required when building host |
| 13 # tools for a CrOS build. | 14 # tools for a CrOS build. |
| 14 assert(current_toolchain == default_toolchain) | 15 assert(current_toolchain == default_toolchain) |
| 15 | 16 |
| 16 pkg_config("atk") { | 17 if (use_atk) { |
| 18 assert(use_glib, "use_atk=true requires that use_glib=true") |
| 19 } |
| 20 |
| 21 pkg_config("atk_base") { |
| 17 packages = [ "atk" ] | 22 packages = [ "atk" ] |
| 18 atk_lib_dir = exec_script(pkg_config_script, | 23 atk_lib_dir = exec_script(pkg_config_script, |
| 19 pkg_config_args + [ | 24 pkg_config_args + [ |
| 20 "--libdir", | 25 "--libdir", |
| 21 "atk", | 26 "atk", |
| 22 ], | 27 ], |
| 23 "string") | 28 "string") |
| 24 defines = [ "ATK_LIB_DIR=\"$atk_lib_dir\"" ] | 29 defines = [ "ATK_LIB_DIR=\"$atk_lib_dir\"" ] |
| 25 } | 30 } |
| 26 | 31 |
| 27 # gn orders flags on a target before flags from configs. The default config | 32 # gn orders flags on a target before flags from configs. The default config |
| 28 # adds -Wall, and these flags have to be after -Wall -- so they need to | 33 # adds -Wall, and these flags have to be after -Wall -- so they need to |
| 29 # come from a config and can't be on the target directly. | 34 # come from a config and can't be on the target directly. |
| 30 config("warnings") { | 35 config("atk") { |
| 36 configs = [ ":atk_base" ] |
| 37 |
| 31 cflags = [ | 38 cflags = [ |
| 32 # glib uses the pre-c++11 typedef-as-static_assert hack. | 39 # glib uses the pre-c++11 typedef-as-static_assert hack. |
| 33 "-Wno-unused-local-typedef", | 40 "-Wno-unused-local-typedef", |
| 34 | 41 |
| 35 # G_DEFINE_TYPE automatically generates a *get_instance_private | 42 # G_DEFINE_TYPE automatically generates a *get_instance_private |
| 36 # inline function after glib 2.37. That's unused. Prevent to | 43 # inline function after glib 2.37. That's unused. Prevent to |
| 37 # complain about it. | 44 # complain about it. |
| 38 "-Wno-unused-function", | 45 "-Wno-unused-function", |
| 39 ] | 46 ] |
| 40 } | 47 } |
| OLD | NEW |