• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2009 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
6  'variables': {
7    'conditions': [
8      ['os_posix == 1 and OS != "mac"', {
9        'os_include': 'linux'
10      }],
11      ['OS=="mac"', {'os_include': 'mac'}],
12      ['OS=="win"', {'os_include': 'win32'}],
13    ],
14    # We used to have a separate flag for using the system
15    # libxslt, but it seems mixing Chrome libxml and system
16    # libxslt causes crashes that nobody has had time to diagnose.
17    # So just put them both behind the same flag for now.
18    'use_system_libxml%': 0,
19  },
20  'targets': [
21    {
22      'target_name': 'libxslt',
23      'conditions': [
24        ['os_posix == 1 and OS != "mac" and use_system_libxml', {
25          'type': 'none',
26          'direct_dependent_settings': {
27            'cflags': [
28              '<!@(pkg-config --cflags libxslt)',
29            ],
30          },
31          'link_settings': {
32            'ldflags': [
33              '<!@(pkg-config --libs-only-L --libs-only-other libxslt)',
34            ],
35            'libraries': [
36              '<!@(pkg-config --libs-only-l libxslt)',
37            ],
38          },
39        }, { # else: os_posix != 1 or OS == "mac" or ! use_system_libxml
40          'type': 'static_library',
41          'sources': [
42            'libxslt/attributes.c',
43            'libxslt/attributes.h',
44            'libxslt/attrvt.c',
45            'libxslt/documents.c',
46            'libxslt/documents.h',
47            'libxslt/extensions.c',
48            'libxslt/extensions.h',
49            'libxslt/extra.c',
50            'libxslt/extra.h',
51            'libxslt/functions.c',
52            'libxslt/functions.h',
53            'libxslt/imports.c',
54            'libxslt/imports.h',
55            'libxslt/keys.c',
56            'libxslt/keys.h',
57            'libxslt/libxslt.h',
58            'libxslt/namespaces.c',
59            'libxslt/namespaces.h',
60            'libxslt/numbers.c',
61            'libxslt/numbersInternals.h',
62            'libxslt/pattern.c',
63            'libxslt/pattern.h',
64            'libxslt/preproc.c',
65            'libxslt/preproc.h',
66            'libxslt/security.c',
67            'libxslt/security.h',
68            'libxslt/templates.c',
69            'libxslt/templates.h',
70            'libxslt/transform.c',
71            'libxslt/transform.h',
72            'libxslt/trio.h',
73            'libxslt/triodef.h',
74            'libxslt/variables.c',
75            'libxslt/variables.h',
76            'libxslt/win32config.h',
77            'libxslt/xslt.c',
78            'libxslt/xslt.h',
79            'libxslt/xsltconfig.h',
80            'libxslt/xsltexports.h',
81            'libxslt/xsltInternals.h',
82            'libxslt/xsltlocale.c',
83            'libxslt/xsltlocale.h',
84            'libxslt/xsltutils.c',
85            'libxslt/xsltutils.h',
86            'libxslt/xsltwin32config.h',
87            'linux/config.h',
88            'mac/config.h',
89            # TODO(port): Need a pregenerated win32/config.h?
90          ],
91          'defines': [
92            'LIBXSLT_STATIC',
93          ],
94          'include_dirs': [
95            '<(os_include)',
96            '.',
97          ],
98          'dependencies': [
99            '../libxml/libxml.gyp:libxml',
100          ],
101          'direct_dependent_settings': {
102            'defines': [
103              'LIBXSLT_STATIC',
104            ],
105            'include_dirs': [
106              '.',
107            ],
108          },
109          'conditions': [
110            ['OS!="win"', {'product_name': 'xslt'}],
111            ['clang == 1', {
112              'xcode_settings': {
113                'WARNING_CFLAGS': [
114                  # libxslt stores a char[3] in a `const unsigned char*`.
115                  '-Wno-pointer-sign',
116                ],
117              },
118              'cflags': [
119                '-Wno-pointer-sign',
120              ],
121            }],
122          ],
123        }],
124      ],
125    },
126  ],
127}
128