Maxim Dzoba | dd96261 | 2017-08-16 17:52:28 -0400 | [diff] [blame] | 1 | %YAML 1.2 |
| 2 | --- | |
| 3 | # GRPC GYP build file |
| 4 | |
| 5 | # 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 gRPC authors. |
| 11 | # |
| 12 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 13 | # you may not use this file except in compliance with the License. |
| 14 | # You may obtain a copy of the License at |
| 15 | # |
| 16 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 17 | # |
| 18 | # Unless required by applicable law or agreed to in writing, software |
| 19 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 20 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 21 | # See the License for the specific language governing permissions and |
| 22 | # limitations under the License. |
| 23 | |
| 24 | { |
| 25 | 'variables': { |
| 26 | # The openssl and zlib dependencies must be passed in as variables |
| 27 | # defined in an included gypi file, usually common.gypi. |
| 28 | 'openssl_gyp_target%': 'Please Define openssl_gyp_target variable', |
| 29 | 'zlib_gyp_target%': 'Please Define zlib_gyp_target variable', |
| 30 | |
| 31 | 'grpc_gcov%': 'false', |
| 32 | 'grpc_alpine%': 'false', |
| 33 | }, |
| 34 | 'target_defaults': { |
| 35 | 'configurations': { |
| 36 | % for name, args in configs.iteritems(): |
| 37 | % if name in ['dbg', 'opt']: |
| 38 | '${{'dbg':'Debug', 'opt': 'Release'}[name]}': { |
| 39 | % for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines')]: |
| 40 | % if args.get(arg, None) is not None: |
| 41 | '${prop}': [ |
| 42 | % for item in args.get(arg).split(): |
| 43 | '${item}', |
| 44 | % endfor |
| 45 | ], |
| 46 | % endif |
| 47 | % endfor |
| 48 | }, |
| 49 | % endif |
| 50 | % endfor |
| 51 | }, |
| 52 | % for arg, prop in [('CPPFLAGS', 'cflags'), ('LDFLAGS', 'ldflags')]: |
| 53 | % if defaults['global'].get(arg, None) is not None: |
| 54 | '${prop}': [ |
| 55 | % for item in defaults['global'].get(arg).split(): |
| 56 | '${item}', |
| 57 | % endfor |
| 58 | ], |
| 59 | % endif |
| 60 | % endfor |
| 61 | 'cflags_c': [ |
| 62 | '-Werror', |
Yihua Zhang | 04fb58e | 2018-03-08 06:49:24 -0800 | [diff] [blame] | 63 | '-std=c99', |
Maxim Dzoba | dd96261 | 2017-08-16 17:52:28 -0400 | [diff] [blame] | 64 | ], |
| 65 | 'cflags_cc': [ |
| 66 | '-Werror', |
Yihua Zhang | 04fb58e | 2018-03-08 06:49:24 -0800 | [diff] [blame] | 67 | '-std=c++11', |
Maxim Dzoba | dd96261 | 2017-08-16 17:52:28 -0400 | [diff] [blame] | 68 | ], |
| 69 | 'include_dirs': [ |
| 70 | '.', |
| 71 | '../..', |
| 72 | 'include', |
| 73 | ], |
| 74 | 'defines': [ |
| 75 | 'GRPC_ARES=0', |
| 76 | ], |
| 77 | 'dependencies': [ |
| 78 | '<(openssl_gyp_target)', |
| 79 | '<(zlib_gyp_target)', |
| 80 | ], |
| 81 | 'conditions': [ |
| 82 | ['grpc_gcov=="true"', { |
| 83 | % for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines'), ('LDFLAGS', 'ldflags')]: |
| 84 | % if configs['gcov'].get(arg, None) is not None: |
| 85 | '${prop}': [ |
| 86 | % for item in configs['gcov'].get(arg).split(): |
| 87 | '${item}', |
| 88 | % endfor |
| 89 | ], |
| 90 | % endif |
| 91 | % endfor |
| 92 | }], |
| 93 | ['grpc_alpine=="true"', { |
| 94 | 'defines': [ |
| 95 | 'GPR_MUSL_LIBC_COMPAT' |
| 96 | ] |
| 97 | }], |
| 98 | ['OS == "win"', { |
| 99 | 'defines': [ |
| 100 | '_WIN32_WINNT=0x0600', |
| 101 | 'WIN32_LEAN_AND_MEAN', |
| 102 | '_HAS_EXCEPTIONS=0', |
| 103 | 'UNICODE', |
| 104 | '_UNICODE', |
| 105 | 'NOMINMAX', |
| 106 | ], |
| 107 | 'msvs_settings': { |
| 108 | 'VCCLCompilerTool': { |
| 109 | 'RuntimeLibrary': 1, # static debug |
| 110 | } |
| 111 | }, |
| 112 | "libraries": [ |
| 113 | "ws2_32" |
| 114 | ] |
| 115 | }], |
| 116 | ['OS == "mac"', { |
| 117 | 'xcode_settings': { |
| 118 | % if defaults['global'].get('CPPFLAGS', None) is not None: |
| 119 | 'OTHER_CFLAGS': [ |
| 120 | % for item in defaults['global'].get('CPPFLAGS').split(): |
| 121 | '${item}', |
| 122 | % endfor |
| 123 | ], |
| 124 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 125 | % for item in defaults['global'].get('CPPFLAGS').split(): |
| 126 | '${item}', |
| 127 | % endfor |
| 128 | '-stdlib=libc++', |
| 129 | '-std=c++11', |
Yihua Zhang | 04fb58e | 2018-03-08 06:49:24 -0800 | [diff] [blame] | 130 | '-Wno-error=deprecated-declarations', |
Maxim Dzoba | dd96261 | 2017-08-16 17:52:28 -0400 | [diff] [blame] | 131 | ], |
| 132 | % endif |
| 133 | }, |
| 134 | }] |
| 135 | ] |
| 136 | }, |
| 137 | 'targets': [ |
| 138 | % for lib in libs: |
| 139 | % if getattr(lib, 'platforms', None) is None and lib.name != 'ares': |
| 140 | { |
| 141 | 'target_name': '${lib.name}', |
| 142 | 'type': 'static_library', |
| 143 | 'dependencies': [ |
| 144 | % for dep in getattr(lib, 'deps', []): |
| 145 | '${dep}', |
| 146 | % endfor |
| 147 | ], |
| 148 | 'sources': [ |
| 149 | % for source in lib.src: |
| 150 | '${source}', |
| 151 | % endfor |
| 152 | ], |
| 153 | }, |
| 154 | % endif |
| 155 | % endfor |
| 156 | ] |
| 157 | } |