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 | { |
murgatroid99 | 38745ef | 2015-09-21 16:39:37 -0700 | [diff] [blame] | 42 | # TODO: Finish windows support |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 43 | '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 | }, |
murgatroid99 | 91b9642 | 2015-09-21 16:43:14 -0700 | [diff] [blame] | 68 | # TODO: Add fallback for Windows, and if pkg-config is not available |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 69 | 'defines': [ |
murgatroid99 | 38745ef | 2015-09-21 16:39:37 -0700 | [diff] [blame] | 70 | 'TSI_OPENSSL_ALPN_SUPPORT=<!(pkg-config --atleast-version=1.0.2 openssl >/dev/null 2>&1 && echo 1 || echo 0)' |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 71 | ], |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 72 | 'include_dirs': [ |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 73 | '.', |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 74 | 'include' |
| 75 | ], |
murgatroid99 | 38745ef | 2015-09-21 16:39:37 -0700 | [diff] [blame] | 76 | # TODO: Check for libraries with pkg-config |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 77 | 'libraries': [ |
| 78 | '-lcrypto', |
| 79 | '-lssl', |
| 80 | '-ldl', |
| 81 | '-lpthread', |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 82 | '-lz' |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 83 | ] |
| 84 | }, |
| 85 | 'targets': [ |
| 86 | % for lib in libs: |
murgatroid99 | 38745ef | 2015-09-21 16:39:37 -0700 | [diff] [blame] | 87 | # TODO: Add C++ targets |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 88 | % if lib.language == 'c': |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 89 | { |
| 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: |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 100 | '${source}', |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 101 | % endfor |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 102 | ], |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 103 | }, |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 104 | % endif |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 105 | % endfor |
| 106 | % for tgt in targets: |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 107 | % if tgt.language == 'c': |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 108 | { |
| 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 | }, |
murgatroid99 | ca9db40 | 2015-09-21 14:39:09 -0700 | [diff] [blame] | 122 | % endif |
murgatroid99 | 2d6d330 | 2015-09-21 13:29:40 -0700 | [diff] [blame] | 123 | % endfor |
| 124 | ] |
| 125 | } |