Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client / src / shared / platform / platform.gyp
1 # -*- python -*-
2 #
3 # Copyright (c) 2012 The Native Client Authors.  All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 {
8   'variables': {
9     'common_sources': [
10       'nacl_check.c',
11       'nacl_check.h',
12       'nacl_find_addrsp.h',
13       'nacl_global_secure_random.c',
14       'nacl_global_secure_random.h',
15       'nacl_host_desc.h',
16       'nacl_host_dir.h',
17       'nacl_host_desc_common.c',
18       'nacl_interruptible_condvar.c',
19       'nacl_interruptible_condvar.h',
20       'nacl_interruptible_mutex.c',
21       'nacl_interruptible_mutex.h',
22       'nacl_log.c',
23       'nacl_log.h',
24       'nacl_secure_random.h',
25       'nacl_secure_random_base.h',
26       'nacl_secure_random_common.c',
27       'nacl_semaphore.h',
28       'nacl_sync.h',
29       'nacl_sync_checked.c',
30       'nacl_sync_checked.h',
31       'nacl_threads.h',
32       'nacl_time.h',
33       'nacl_time_common.c',
34       'nacl_timestamp.h',
35       'platform_init.c',
36       'refcount_base.cc',
37     ],
38     'conditions': [
39       ['OS=="linux"', {
40         'platform_sources': [
41           'linux/nacl_clock.c',
42           'linux/nacl_host_dir.c',
43           'linux/nacl_semaphore.c',
44         ],
45       }],
46       ['OS=="mac"', {
47         'platform_sources': [
48           'osx/nacl_clock.c',
49           'osx/nacl_host_dir.c',
50           'osx/nacl_semaphore.c',
51           'osx/strnlen_osx.c',
52         ],
53       }],
54       ['OS=="linux" or OS=="mac"', {
55         'platform_sources': [
56           'posix/aligned_malloc.c',
57           'posix/condition_variable.c',
58           'posix/lock.c',
59           'posix/nacl_exit.c',
60           'posix/nacl_fast_mutex.c',
61           'posix/nacl_file_lock.c',
62           'posix/nacl_find_addrsp.c',
63           'posix/nacl_host_desc.c',
64           'posix/nacl_secure_random.c',
65           'posix/nacl_thread_id.c',
66           'posix/nacl_threads.c',
67           'posix/nacl_time.c',
68           'posix/nacl_timestamp.c',
69         ],
70       }],
71       ['OS=="win"', {
72         'platform_sources': [
73           'win/aligned_malloc.c',
74           'win/condition_variable.cc',
75           'win/lock.cc',
76           'win/nacl_clock.c',
77           'win/nacl_exit.c',
78           'win/nacl_fast_mutex.c',
79           'win/nacl_find_addrsp.c',
80           'win/nacl_host_desc.c',
81           'win/nacl_host_dir.c',
82           'win/lock_impl_win.cc',
83           'win/nacl_secure_random.c',
84           'win/nacl_semaphore.c',
85           'win/nacl_sync_win.cc',
86           'win/nacl_threads.c',
87           'win/nacl_time.c',
88           'win/nacl_timestamp.c',
89           'win/port_win.c',
90           'win/time.cc',
91           'win/time.h',
92           'win/time_win.cc',
93           'win/xlate_system_error.c',
94         ],
95       }],
96     ],
97   },
98   'includes': [
99     '../../../build/common.gypi',
100   ],
101   'target_defaults': {
102     'variables': {
103       'target_base': 'none',
104     },
105     'target_conditions': [
106       ['OS=="linux" or OS=="mac"', {
107         'cflags': [
108           '-Wno-long-long',
109         ],
110       }],
111       ['target_base=="platform_lib"', {
112         'sources': [
113           '<@(common_sources)',
114           '<@(platform_sources)',
115         ],
116       }],
117       ['target_base=="platform_tests"', {
118           'sources': [
119             'platform_tests.cc',
120           ],
121           'conditions': [[
122             'OS=="win"', {
123               'sources': [
124                 'win/port_win_test.c',
125               ],
126             }
127           ]]
128         }
129       ]
130     ],
131   },
132   'targets': [
133     # ----------------------------------------------------------------------
134     {
135       'target_name': 'platform',
136       'type': 'static_library',
137       # tls_edit relies on this which is always built for the host platform.
138       'toolsets': ['host', 'target'],
139       'variables': {
140         'target_base': 'platform_lib',
141       },
142       'dependencies': [
143         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
144       ],
145     },
146     # ----------------------------------------------------------------------
147     {
148       'target_name': 'platform_tests',
149       'type': 'executable',
150       'variables': {
151         'target_base': 'platform_tests',
152       },
153       'dependencies': [
154         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
155         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
156       ],
157     },
158     {
159       'target_name': 'platform_lib',
160       'type': 'none',
161       'variables': {
162         'nlib_target': 'libplatform.a',
163         'nso_target': 'libplatform.so',
164         'build_glibc': 1,
165         'build_newlib': 1,
166         'build_pnacl_newlib': 1,
167         'build_irt': 1,
168         'sources': [
169           'nacl_check.c',
170           'nacl_log.c',
171           'posix/condition_variable.c',
172           'posix/lock.c',
173           'posix/nacl_exit.c',
174           'posix/nacl_thread_id.c',
175           'posix/nacl_threads.c',
176           'posix/nacl_timestamp.c',
177           'nacl_sync_checked.c',
178           'refcount_base.cc',
179         ]
180         },
181       'dependencies': [
182         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
183       ],
184     },
185     # ----------------------------------------------------------------------
186   ],
187   'conditions': [
188     ['OS=="win" and target_arch=="ia32"', {
189       'targets': [
190         # ---------------------------------------------------------------------
191         {
192           'target_name': 'platform64',
193           'type': 'static_library',
194           'variables': {
195             'target_base': 'platform_lib',
196             'win_target': 'x64',
197           },
198           'dependencies': [
199             '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
200           ],
201         },
202         # ---------------------------------------------------------------------
203         {
204           'target_name': 'platform_tests64',
205           'type': 'executable',
206           'variables': {
207             'target_base': 'platform_tests',
208             'win_target': 'x64',
209           },
210           'sources': [
211             'win/test_tls.S',
212           ],
213           'dependencies': [
214             '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
215             '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
216           ],
217         },
218       ],
219     }],
220   ],
221 }