blob: c1e2530c4ca53277a6dea71b97df874d9c03b700 [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.orgc2a93752012-05-02 00:18:22 +000086 'dependencies': [
87 'third_party/lzma_sdk/lzma_sdk.gyp:ots_lzma_sdk',
88 ],
bashi@chromium.org54651a62011-02-18 09:05:42 +000089 'include_dirs': [
90 '<@(ots_include_dirs)',
91 ],
92 'direct_dependent_settings': {
93 'include_dirs': [
94 '<@(ots_include_dirs)',
95 ],
96 },
97 },
98 {
bashi@chromium.org8d71e042012-05-07 08:45:16 +000099 'target_name': 'freetype2',
100 'type': 'none',
101 'conditions': [
102 ['OS=="linux"', {
103 'direct_dependent_settings': {
104 'cflags': [
105 '<!(pkg-config freetype2 --cflags)',
106 ],
ksakamoto@chromium.org123cae82013-04-02 01:43:21 +0000107 'link_settings': {
108 'libraries': [
109 '<!(pkg-config freetype2 --libs)',
110 ],
111 },
bashi@chromium.org8d71e042012-05-07 08:45:16 +0000112 },
113 }],
114 ],
115 },
116 {
bashi@chromium.org54651a62011-02-18 09:05:42 +0000117 'target_name': 'idempotent',
118 'type': 'executable',
119 'sources': [
120 'test/idempotent.cc',
121 ],
122 'dependencies': [
123 'ots',
124 ],
125 'conditions': [
126 ['OS=="linux"', {
ksakamoto@chromium.org123cae82013-04-02 01:43:21 +0000127 'dependencies': [
128 'freetype2',
129 ]
130 }],
131 ['OS=="win"', {
132 'link_settings': {
133 'libraries': [
134 '-lgdi32.lib',
135 ],
136 },
bashi@chromium.org54651a62011-02-18 09:05:42 +0000137 }],
138 ],
139 },
bashi@chromium.org8d71e042012-05-07 08:45:16 +0000140 {
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 }],
bashi@chromium.org54651a62011-02-18 09:05:42 +0000199 ],
200}