blob: 0692edb753b48f00d1dbd50a516621aaae9e14b1 [file] [log] [blame]
Craig Tiller3dca23a2016-01-21 11:44:55 -08001#!/usr/bin/env python2.7
Craig Tillerde5d0902016-01-21 14:16:19 -08002
Craig Tiller6169d5f2016-03-31 07:46:18 -07003# Copyright 2015, Google Inc.
Craig Tillerde5d0902016-01-21 14:16:19 -08004# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met:
9#
10# * Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer.
12# * Redistributions in binary form must reproduce the above
13# copyright notice, this list of conditions and the following disclaimer
14# in the documentation and/or other materials provided with the
15# distribution.
16# * Neither the name of Google Inc. nor the names of its
17# contributors may be used to endorse or promote products derived from
18# this software without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
Craig Tiller3dca23a2016-01-21 11:44:55 -080032import re
33import os
34import sys
35import yaml
36
37os.chdir(os.path.dirname(sys.argv[0])+'/../..')
38
39out = {}
40
41try:
42 with open('third_party/zlib/CMakeLists.txt') as f:
43 cmake = f.read()
44
45 def cmpath(x):
46 return 'third_party/zlib/%s' % x.replace('${CMAKE_CURRENT_BINARY_DIR}/', '')
47
48 def cmvar(name):
49 regex = r'set\(\s*'
50 regex += name
51 regex += r'([^)]*)\)'
52 return [cmpath(x) for x in re.search(regex, cmake).group(1).split()]
53
54 out['libs'] = [{
55 'name': 'z',
56 'zlib': True,
Nicolas "Pixel" Noble51b1aee2016-01-28 01:14:58 +010057 'defaults': 'zlib',
Craig Tiller3dca23a2016-01-21 11:44:55 -080058 'build': 'private',
59 'language': 'c',
60 'secure': 'no',
61 'src': sorted(cmvar('ZLIB_SRCS')),
62 'headers': sorted(cmvar('ZLIB_PUBLIC_HDRS') + cmvar('ZLIB_PRIVATE_HDRS')),
63 }]
64except:
65 pass
66
67print yaml.dump(out)
68