Update To 11.40.268.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" or OS=="android"', {
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_posix==1', {
55         'platform_sources': [
56           'posix/aligned_malloc.c',
57           'posix/condition_variable.c',
58           'posix/lock.c',
59           'posix/nacl_error.c',
60           'posix/nacl_exit.c',
61           'posix/nacl_fast_mutex.c',
62           'posix/nacl_file_lock.c',
63           'posix/nacl_find_addrsp.c',
64           'posix/nacl_host_desc.c',
65           'posix/nacl_secure_random.c',
66           'posix/nacl_thread_id.c',
67           'posix/nacl_threads.c',
68           'posix/nacl_time.c',
69           'posix/nacl_timestamp.c',
70         ],
71       }],
72       ['OS=="win"', {
73         'platform_sources': [
74           'win/aligned_malloc.c',
75           'win/condition_variable.cc',
76           'win/lock.cc',
77           'win/nacl_clock.c',
78           'win/nacl_error.c',
79           'win/nacl_exit.c',
80           'win/nacl_fast_mutex.c',
81           'win/nacl_find_addrsp.c',
82           'win/nacl_host_desc.c',
83           'win/nacl_host_dir.c',
84           'win/lock_impl_win.cc',
85           'win/nacl_secure_random.c',
86           'win/nacl_semaphore.c',
87           'win/nacl_sync_win.cc',
88           'win/nacl_threads.c',
89           'win/nacl_time.c',
90           'win/nacl_timestamp.c',
91           'win/port_win.c',
92           'win/time.cc',
93           'win/time.h',
94           'win/time_win.cc',
95           'win/xlate_system_error.c',
96         ],
97       }],
98     ],
99   },
100   'includes': [
101     '../../../build/common.gypi',
102   ],
103   'target_defaults': {
104     'variables': {
105       'target_base': 'none',
106     },
107     'target_conditions': [
108       ['<(os_posix)==1', {
109         'cflags': [
110           '-Wno-long-long',
111         ],
112       }],
113       ['target_base=="platform_lib"', {
114         'sources': [
115           '<@(common_sources)',
116           '<@(platform_sources)',
117         ],
118       }],
119       ['target_base=="platform_tests"', {
120           'sources': [
121             'platform_tests.cc',
122           ],
123           'conditions': [[
124             'OS=="win"', {
125               'sources': [
126                 'win/port_win_test.c',
127               ],
128             }
129           ]]
130         }
131       ]
132     ],
133   },
134   'targets': [
135     # ----------------------------------------------------------------------
136     {
137       'target_name': 'platform',
138       'type': 'static_library',
139       # tls_edit relies on this which is always built for the host platform.
140       'toolsets': ['host', 'target'],
141       'variables': {
142         'target_base': 'platform_lib',
143       },
144       'dependencies': [
145         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
146       ],
147     },
148     # ----------------------------------------------------------------------
149     {
150       'target_name': 'platform_tests',
151       'type': 'executable',
152       'variables': {
153         'target_base': 'platform_tests',
154       },
155       'dependencies': [
156         '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
157         '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
158       ],
159     },
160     {
161       'target_name': 'platform_lib',
162       'type': 'none',
163       'variables': {
164         'nlib_target': 'libplatform.a',
165         'nso_target': 'libplatform.so',
166         'build_glibc': 1,
167         'build_newlib': 1,
168         'build_pnacl_newlib': 1,
169         'build_irt': 1,
170         'build_nonsfi_helper': 1,
171         'sources': [
172           'nacl_check.c',
173           'nacl_log.c',
174           'posix/condition_variable.c',
175           'posix/lock.c',
176           'posix/nacl_error.c',
177           'posix/nacl_exit.c',
178           'posix/nacl_thread_id.c',
179           'posix/nacl_threads.c',
180           'posix/nacl_timestamp.c',
181           'nacl_sync_checked.c',
182           'refcount_base.cc',
183         ]
184         },
185       'dependencies': [
186         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
187       ],
188     },
189     # ----------------------------------------------------------------------
190   ],
191   'conditions': [
192     ['OS=="win" and target_arch=="ia32"', {
193       'targets': [
194         # ---------------------------------------------------------------------
195         {
196           'target_name': 'platform64',
197           'type': 'static_library',
198           'variables': {
199             'target_base': 'platform_lib',
200             'win_target': 'x64',
201           },
202           'dependencies': [
203             '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
204           ],
205         },
206         # ---------------------------------------------------------------------
207         {
208           'target_name': 'platform_tests64',
209           'type': 'executable',
210           'variables': {
211             'target_base': 'platform_tests',
212             'win_target': 'x64',
213           },
214           'sources': [
215             'win/test_tls.S',
216           ],
217           'dependencies': [
218             '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
219             '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
220           ],
221         },
222       ],
223     }],
224   ],
225 }