blob: 90ab4ec7296524d044edf2b28dff02f0465d99ee [file] [log] [blame]
bashi@chromium.orgc2a93752012-05-02 00:18:22 +00001# Copyright (c) 2012 The Chromium Authors. All rights reserved.
bashi@chromium.org54651a62011-02-18 09:05:42 +00002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
bashi@chromium.org54651a62011-02-18 09:05:42 +00006 'variables': {
7 'gcc_cflags': [
8 '-ggdb',
9 '-W',
10 '-Wall',
bashi@chromium.org8d71e042012-05-07 08:45:16 +000011 '-Werror',
bashi@chromium.org54651a62011-02-18 09:05:42 +000012 '-Wno-unused-parameter',
bashi@chromium.org54651a62011-02-18 09:05:42 +000013 '-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': {
bashi@chromium.org54651a62011-02-18 09:05:42 +000027 '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',
bashi@chromium.org54651a62011-02-18 09:05:42 +000061 ],
62 },
63 'msvs_settings': {
64 'VCLinkerTool': {
ksakamoto@chromium.org123cae82013-04-02 01:43:21 +000065 'AdditionalLibraryDirectories': ['third_party/zlib'],
bashi@chromium.org54651a62011-02-18 09:05:42 +000066 'DelayLoadDLLs': ['zlib1.dll'],
67 },
68 },
ksakamoto@chromium.org123cae82013-04-02 01:43:21 +000069 'include_dirs': [
70 'third_party/zlib'
71 ],
72 'defines': [
73 'NOMINMAX', # To suppress max/min macro definition.
74 'WIN32',
75 ],
bashi@chromium.org54651a62011-02-18 09:05:42 +000076 }],
77 ],
78 },
79 'targets': [
80 {
81 'target_name': 'ots',
82 'type': 'static_library',
83 'sources': [
84 '<@(ots_sources)',
85 ],
bashi@chromium.org6462c582014-06-27 06:24:49 +000086 'defines': [
87 'OTS_DEBUG',
88 ],
bashi@chromium.orgc2a93752012-05-02 00:18:22 +000089 'dependencies': [
90 'third_party/lzma_sdk/lzma_sdk.gyp:ots_lzma_sdk',
91 ],
bashi@chromium.org54651a62011-02-18 09:05:42 +000092 'include_dirs': [
93 '<@(ots_include_dirs)',
94 ],
95 'direct_dependent_settings': {
96 'include_dirs': [
97 '<@(ots_include_dirs)',
98 ],
99 },
100 },
101 {
bashi@chromium.org8d71e042012-05-07 08:45:16 +0000102 'target_name': 'freetype2',
103 'type': 'none',
104 'conditions': [
105 ['OS=="linux"', {
106 'direct_dependent_settings': {
107 'cflags': [
108 '<!(pkg-config freetype2 --cflags)',
109 ],
ksakamoto@chromium.org123cae82013-04-02 01:43:21 +0000110 'link_settings': {
111 'libraries': [
112 '<!(pkg-config freetype2 --libs)',
113 ],
114 },
bashi@chromium.org8d71e042012-05-07 08:45:16 +0000115 },
116 }],
117 ],
118 },
119 {
bashi@chromium.org54651a62011-02-18 09:05:42 +0000120 'target_name': 'idempotent',
121 'type': 'executable',
122 'sources': [
123 'test/idempotent.cc',
124 ],
125 'dependencies': [
126 'ots',
127 ],
128 'conditions': [
129 ['OS=="linux"', {
ksakamoto@chromium.org123cae82013-04-02 01:43:21 +0000130 'dependencies': [
131 'freetype2',
132 ]
133 }],
134 ['OS=="win"', {
135 'link_settings': {
136 'libraries': [
137 '-lgdi32.lib',
138 ],
139 },
bashi@chromium.org54651a62011-02-18 09:05:42 +0000140 }],
141 ],
142 },
bashi@chromium.org8d71e042012-05-07 08:45:16 +0000143 {
144 'target_name': 'ot-sanitise',
145 'type': 'executable',
146 'sources': [
147 'test/ot-sanitise.cc',
148 'test/file-stream.h',
149 ],
150 'dependencies': [
151 'ots',
152 ],
153 },
154 ],
155 'conditions': [
156 ['OS=="linux" or OS=="mac"', {
157 'targets': [
158 {
159 'target_name': 'validator_checker',
160 'type': 'executable',
161 'sources': [
162 'test/validator-checker.cc',
163 ],
164 'dependencies': [
165 'ots',
166 ],
167 'conditions': [
168 ['OS=="linux"', {
169 'dependencies': [
170 'freetype2',
171 ]
172 }],
173 ],
174 },
175 {
176 'target_name': 'perf',
177 'type': 'executable',
178 'sources': [
179 'test/perf.cc',
180 ],
181 'dependencies': [
182 'ots',
183 ],
184 },
185 ],
186 }],
187 ['OS=="linux"', {
188 'targets': [
189 {
190 'target_name': 'side_by_side',
191 'type': 'executable',
192 'sources': [
193 'test/side-by-side.cc',
194 ],
195 'dependencies': [
196 'freetype2',
197 'ots',
198 ],
199 },
200 ],
201 }],
bashi@chromium.org54651a62011-02-18 09:05:42 +0000202 ],
203}