1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 5 { 6 'variables': { 7 'gcc_cflags': [ 8 '-ggdb', 9 '-W', 10 '-Wall', 11 '-Werror', 12 '-Wno-unused-parameter', 13 '-fPIE', 14 '-fstack-protector', 15 ], 16 'gcc_ldflags': [ 17 '-ggdb', 18 '-fpie', 19 '-Wl,-z,relro', 20 '-Wl,-z,now', 21 ], 22 }, 23 'includes': [ 24 'ots-common.gypi', 25 ], 26 'target_defaults': { 27 'conditions': [ 28 ['OS=="linux"', { 29 'cflags': [ 30 '<@(gcc_cflags)', 31 ], 32 'ldflags': [ 33 '<@(gcc_ldflags)', 34 ], 35 'defines': [ 36 '_FORTIFY_SOURCE=2', 37 ], 38 'link_settings': { 39 'libraries': ['-lz'], 40 }, 41 }], 42 ['OS=="mac"', { 43 'xcode_settings': { 44 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic 45 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden 46 'OTHER_CFLAGS': [ 47 '<@(gcc_cflags)', 48 ], 49 }, 50 'link_settings': { 51 'libraries': [ 52 '/System/Library/Frameworks/ApplicationServices.framework', 53 '/usr/lib/libz.dylib' 54 ], 55 }, 56 }], 57 ['OS=="win"', { 58 'link_settings': { 59 'libraries': [ 60 '-lzdll.lib', 61 ], 62 }, 63 'msvs_settings': { 64 'VCLinkerTool': { 65 'AdditionalLibraryDirectories': ['third_party/zlib'], 66 'DelayLoadDLLs': ['zlib1.dll'], 67 }, 68 }, 69 'include_dirs': [ 70 'third_party/zlib' 71 ], 72 'defines': [ 73 'NOMINMAX', # To suppress max/min macro definition. 74 'WIN32', 75 ], 76 }], 77 ], 78 }, 79 'targets': [ 80 { 81 'target_name': 'ots', 82 'type': 'static_library', 83 'sources': [ 84 '<@(ots_sources)', 85 ], 86 'dependencies': [ 87 'third_party/lzma_sdk/lzma_sdk.gyp:ots_lzma_sdk', 88 ], 89 'include_dirs': [ 90 '<@(ots_include_dirs)', 91 ], 92 'direct_dependent_settings': { 93 'include_dirs': [ 94 '<@(ots_include_dirs)', 95 ], 96 }, 97 }, 98 { 99 'target_name': 'freetype2', 100 'type': 'none', 101 'conditions': [ 102 ['OS=="linux"', { 103 'direct_dependent_settings': { 104 'cflags': [ 105 '<!(pkg-config freetype2 --cflags)', 106 ], 107 'link_settings': { 108 'libraries': [ 109 '<!(pkg-config freetype2 --libs)', 110 ], 111 }, 112 }, 113 }], 114 ], 115 }, 116 { 117 'target_name': 'idempotent', 118 'type': 'executable', 119 'sources': [ 120 'test/idempotent.cc', 121 ], 122 'dependencies': [ 123 'ots', 124 ], 125 'conditions': [ 126 ['OS=="linux"', { 127 'dependencies': [ 128 'freetype2', 129 ] 130 }], 131 ['OS=="win"', { 132 'link_settings': { 133 'libraries': [ 134 '-lgdi32.lib', 135 ], 136 }, 137 }], 138 ], 139 }, 140 { 141 'target_name': 'ot-sanitise', 142 'type': 'executable', 143 'sources': [ 144 'test/ot-sanitise.cc', 145 'test/file-stream.h', 146 ], 147 'dependencies': [ 148 'ots', 149 ], 150 }, 151 ], 152 'conditions': [ 153 ['OS=="linux" or OS=="mac"', { 154 'targets': [ 155 { 156 'target_name': 'validator_checker', 157 'type': 'executable', 158 'sources': [ 159 'test/validator-checker.cc', 160 ], 161 'dependencies': [ 162 'ots', 163 ], 164 'conditions': [ 165 ['OS=="linux"', { 166 'dependencies': [ 167 'freetype2', 168 ] 169 }], 170 ], 171 }, 172 { 173 'target_name': 'perf', 174 'type': 'executable', 175 'sources': [ 176 'test/perf.cc', 177 ], 178 'dependencies': [ 179 'ots', 180 ], 181 }, 182 ], 183 }], 184 ['OS=="linux"', { 185 'targets': [ 186 { 187 'target_name': 'side_by_side', 188 'type': 'executable', 189 'sources': [ 190 'test/side-by-side.cc', 191 ], 192 'dependencies': [ 193 'freetype2', 194 'ots', 195 ], 196 }, 197 ], 198 }], 199 ], 200 } 201