Linux: use generated library loader for gsettings.

BUG=162733
TEST=Test proxy settings on a system with GNOME3.

Review URL: https://codereview.chromium.org/11348279

git-svn-id: http://src.chromium.org/svn/trunk/src/build@170544 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
phajdan.jr@chromium.org 2012-11-30 21:22:34 +00:00
Родитель e1d9c912ea
Коммит 9ecc5f6ac7
2 изменённых файлов: 79 добавлений и 7 удалений

30
linux/gsettings.h Normal file
Просмотреть файл

@ -0,0 +1,30 @@
// Copyright (c) 2012 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.
#ifndef BUILD_LINUX_GSETTINGS_H_
#define BUILD_LINUX_GSETTINGS_H_
#include <gio/gio.h>
// The GSettings API was not part of GIO until GIO version 2.26,
// while Ubuntu 10.04 Lucid ships with version 2.24.
//
// To allow compiling on Lucid those forward declarations are provided.
//
// If compiling with GIO version 2.26, these won't conflict,
// because they're identical to the types defined.
//
// TODO(phajdan.jr): This will no longer be needed after switch to Precise,
// see http://crbug.com/158577 .
struct _GSettings;
typedef struct _GSettings GSettings;
GSettings* g_settings_new(const gchar* schema);
GSettings* g_settings_get_child(GSettings* settings, const gchar* name);
gboolean g_settings_get_boolean(GSettings* settings, const gchar* key);
gchar* g_settings_get_string(GSettings* settings, const gchar* key);
gint g_settings_get_int(GSettings* settings, const gchar* key);
gchar** g_settings_get_strv(GSettings* settings, const gchar* key);
const gchar* const* g_settings_list_schemas();
#endif // BUILD_LINUX_GSETTINGS_H_

Просмотреть файл

@ -242,9 +242,15 @@
},
{
'target_name': 'gio',
'type': 'none',
'type': 'static_library',
'conditions': [
['use_gio==1 and _toolset=="target"', {
'dependencies': [
'../../base/base.gyp:base',
],
'cflags': [
'<!@(<(pkg-config) --cflags gio-2.0)',
],
'direct_dependent_settings': {
'cflags': [
'<!@(<(pkg-config) --cflags gio-2.0)',
@ -252,10 +258,8 @@
'defines': [
'USE_GIO',
],
'conditions': [
['linux_link_gsettings==0', {
'defines': ['DLOPEN_GSETTINGS'],
}],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
],
},
'link_settings': {
@ -273,6 +277,44 @@
}],
],
},
'hard_dependency': 1,
'actions': [
{
'variables': {
'output_h': '<(SHARED_INTERMEDIATE_DIR)/library_loaders/libgio.h',
'output_cc': '<(INTERMEDIATE_DIR)/libgio_loader.cc',
'generator': '../../tools/generate_library_loader/generate_library_loader.py',
},
'action_name': 'generate_libgio_loader',
'inputs': [
'<(generator)',
],
'outputs': [
'<(output_h)',
'<(output_cc)',
],
'action': ['python',
'<(generator)',
'--name', 'LibGioLoader',
'--output-h', '<(output_h)',
'--output-cc', '<(output_cc)',
'--header', '<gio/gio.h>',
# TODO(phajdan.jr): This will no longer be needed
# after switch to Precise, http://crbug.com/158577 .
'--bundled-header', '"build/linux/gsettings.h"',
'--link-directly=<(linux_link_gsettings)',
'g_settings_new',
'g_settings_get_child',
'g_settings_get_string',
'g_settings_get_boolean',
'g_settings_get_int',
'g_settings_get_strv',
'g_settings_list_schemas',
],
'message': 'Generating libgio library loader.',
'process_outputs_as_sources': 1,
},
],
}],
],
},
@ -282,8 +324,8 @@
'cflags': [
'<!@(<(pkg-config) --cflags libpci)',
],
'include_dirs': [
'../..',
'dependencies': [
'../../base/base.gyp:base',
],
'direct_dependent_settings': {
'include_dirs': [