murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 1 | %YAML 1.2 |
| 2 | --- | |
| 3 | # GRPC gyp file |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 4 | # This currently builds C code. |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 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, 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 | { |
| 42 | 'target_defaults': { |
| 43 | 'default_configuration': 'Debug', |
| 44 | 'configurations': { |
| 45 | 'Debug': { |
| 46 | 'defines': [ 'DEBUG', '_DEBUG' ], |
| 47 | 'msvs_settings': { |
| 48 | 'VCCLCompilerTool': { |
| 49 | 'RuntimeLibrary': 1, # static debug |
| 50 | }, |
| 51 | }, |
| 52 | }, |
| 53 | 'Release': { |
| 54 | 'defines': [ 'NDEBUG' ], |
| 55 | 'msvs_settings': { |
| 56 | 'VCCLCompilerTool': { |
| 57 | 'RuntimeLibrary': 0, # static release |
| 58 | }, |
| 59 | }, |
| 60 | } |
| 61 | }, |
| 62 | 'msvs_settings': { |
| 63 | 'VCLinkerTool': { |
| 64 | 'GenerateDebugInformation': 'true', |
| 65 | }, |
| 66 | }, |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 67 | 'defines': [ |
| 68 | # TODO: Properly check for ALPN support |
| 69 | 'TSI_OPENSSL_ALPN_SUPPORT=0' |
| 70 | ], |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 71 | 'include_dirs': [ |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 72 | '.', |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 73 | 'include' |
| 74 | ], |
| 75 | 'libraries': [ |
| 76 | '-lcrypto', |
| 77 | '-lssl', |
| 78 | '-ldl', |
| 79 | '-lpthread', |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 80 | '-lz' |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 81 | ] |
| 82 | }, |
| 83 | 'targets': [ |
| 84 | % for lib in libs: |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 85 | % if lib.language == 'c': |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 86 | { |
| 87 | 'target_name': '${lib.name}', |
| 88 | 'product_prefix': 'lib', |
| 89 | 'type': 'static_library', |
| 90 | 'dependencies': [ |
| 91 | % for dep in getattr(lib, 'deps', []): |
| 92 | '${dep}', |
| 93 | % endfor |
| 94 | ], |
| 95 | 'sources': [ |
| 96 | % for source in lib.src: |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 97 | '${source}', |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 98 | % endfor |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 99 | ], |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 100 | }, |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 101 | % endif |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 102 | % endfor |
| 103 | % for tgt in targets: |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 104 | % if tgt.language == 'c': |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 105 | { |
| 106 | 'target_name': '${tgt.name}', |
| 107 | 'type': 'executable', |
| 108 | 'dependencies': [ |
| 109 | % for dep in getattr(tgt, 'deps', []): |
| 110 | '${dep}', |
| 111 | % endfor |
| 112 | ], |
| 113 | 'sources': [ |
| 114 | % for source in tgt.src: |
| 115 | '${source}', |
| 116 | % endfor |
| 117 | ] |
| 118 | }, |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame^] | 119 | % endif |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 120 | % endfor |
| 121 | ] |
| 122 | } |