blob: 873606202a1d74a80d6b0f5b22f859750b63fe4b [file] [log] [blame]
murgatroid992d6d3302015-09-21 13:29:40 -07001%YAML 1.2
2--- |
3 # GRPC gyp file
murgatroid99ca9db402015-09-21 14:39:09 -07004 # This currently builds C code.
murgatroid992d6d3302015-09-21 13:29:40 -07005 # This file has been automatically generated from a template file.
6 # Please look at the templates directory instead.
7 # This file can be regenerated from the template by running
8 # tools/buildgen/generate_projects.sh
9
10 # Copyright 2015, Google Inc.
11 # All rights reserved.
12 #
13 # Redistribution and use in source and binary forms, with or without
14 # modification, are permitted provided that the following conditions are
15 # met:
16 #
17 # * Redistributions of source code must retain the above copyright
18 # notice, this list of conditions and the following disclaimer.
19 # * Redistributions in binary form must reproduce the above
20 # copyright notice, this list of conditions and the following disclaimer
21 # in the documentation and/or other materials provided with the
22 # distribution.
23 # * Neither the name of Google Inc. nor the names of its
24 # contributors may be used to endorse or promote products derived from
25 # this software without specific prior written permission.
26 #
27 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
39 # Some of this file is built with the help of
40 # https://n8.io/converting-a-c-library-to-gyp/
41 {
murgatroid9938745ef2015-09-21 16:39:37 -070042 # TODO: Finish windows support
murgatroid992d6d3302015-09-21 13:29:40 -070043 'target_defaults': {
44 'default_configuration': 'Debug',
45 'configurations': {
46 'Debug': {
47 'defines': [ 'DEBUG', '_DEBUG' ],
48 'msvs_settings': {
49 'VCCLCompilerTool': {
50 'RuntimeLibrary': 1, # static debug
51 },
52 },
53 },
54 'Release': {
55 'defines': [ 'NDEBUG' ],
56 'msvs_settings': {
57 'VCCLCompilerTool': {
58 'RuntimeLibrary': 0, # static release
59 },
60 },
61 }
62 },
63 'msvs_settings': {
64 'VCLinkerTool': {
65 'GenerateDebugInformation': 'true',
66 },
67 },
murgatroid9991b96422015-09-21 16:43:14 -070068 # TODO: Add fallback for Windows, and if pkg-config is not available
murgatroid99ca9db402015-09-21 14:39:09 -070069 'defines': [
murgatroid9938745ef2015-09-21 16:39:37 -070070 'TSI_OPENSSL_ALPN_SUPPORT=<!(pkg-config --atleast-version=1.0.2 openssl >/dev/null 2>&1 && echo 1 || echo 0)'
murgatroid99ca9db402015-09-21 14:39:09 -070071 ],
murgatroid992d6d3302015-09-21 13:29:40 -070072 'include_dirs': [
murgatroid99ca9db402015-09-21 14:39:09 -070073 '.',
murgatroid992d6d3302015-09-21 13:29:40 -070074 'include'
75 ],
murgatroid9938745ef2015-09-21 16:39:37 -070076 # TODO: Check for libraries with pkg-config
murgatroid992d6d3302015-09-21 13:29:40 -070077 'libraries': [
78 '-lcrypto',
79 '-lssl',
80 '-ldl',
81 '-lpthread',
murgatroid99ca9db402015-09-21 14:39:09 -070082 '-lz'
murgatroid992d6d3302015-09-21 13:29:40 -070083 ]
84 },
85 'targets': [
86 % for lib in libs:
murgatroid9938745ef2015-09-21 16:39:37 -070087 # TODO: Add C++ targets
murgatroid99ca9db402015-09-21 14:39:09 -070088 % if lib.language == 'c':
murgatroid992d6d3302015-09-21 13:29:40 -070089 {
90 'target_name': '${lib.name}',
91 'product_prefix': 'lib',
92 'type': 'static_library',
93 'dependencies': [
94 % for dep in getattr(lib, 'deps', []):
95 '${dep}',
96 % endfor
97 ],
98 'sources': [
99 % for source in lib.src:
murgatroid99ca9db402015-09-21 14:39:09 -0700100 '${source}',
murgatroid992d6d3302015-09-21 13:29:40 -0700101 % endfor
murgatroid99ca9db402015-09-21 14:39:09 -0700102 ],
murgatroid992d6d3302015-09-21 13:29:40 -0700103 },
murgatroid99ca9db402015-09-21 14:39:09 -0700104 % endif
murgatroid992d6d3302015-09-21 13:29:40 -0700105 % endfor
106 % for tgt in targets:
murgatroid99ca9db402015-09-21 14:39:09 -0700107 % if tgt.language == 'c':
murgatroid992d6d3302015-09-21 13:29:40 -0700108 {
109 'target_name': '${tgt.name}',
110 'type': 'executable',
111 'dependencies': [
112 % for dep in getattr(tgt, 'deps', []):
113 '${dep}',
114 % endfor
115 ],
116 'sources': [
117 % for source in tgt.src:
118 '${source}',
119 % endfor
120 ]
121 },
murgatroid99ca9db402015-09-21 14:39:09 -0700122 % endif
murgatroid992d6d3302015-09-21 13:29:40 -0700123 % endfor
124 ]
125 }