OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright 2010 The Native Client Authors. All rights reserved. | 2 # Copyright 2010 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can | 3 # Use of this source code is governed by a BSD-style license that can |
4 # be found in the LICENSE file. | 4 # be found in the LICENSE file. |
5 | 5 |
| 6 import gyp_extract |
| 7 |
6 Import('env') | 8 Import('env') |
7 | 9 |
8 env.Prepend(CPPDEFINES=['XP_UNIX']) | 10 env.Prepend(CPPDEFINES=['XP_UNIX']) |
9 | 11 |
10 # TODO(robertm): those should not be necessary once we go -std=c99 | 12 # TODO(robertm): those should not be necessary once we go -std=c99 |
11 env.FilterOut(CFLAGS=['-pedantic']) | 13 env.FilterOut(CFLAGS=['-pedantic']) |
12 env.FilterOut(CCFLAGS=['-pedantic']) | 14 env.FilterOut(CCFLAGS=['-pedantic']) |
13 | 15 |
| 16 |
| 17 # Load ppapi_cpp.gypi |
| 18 ppapi_cpp_gypi = gyp_extract.LoadGypFile( |
| 19 env.File('#/../ppapi/ppapi_cpp.gypi').path) |
| 20 |
| 21 # From ppapi_cpp.gypi:ppapi_cpp_objects:cpp/[^/]*\.h |
| 22 cpp_headers = gyp_extract.GypTargetSources( |
| 23 ppapi_cpp_gypi, 'ppapi_cpp_objects', 'cpp/[^/]*\.h') |
| 24 cpp_headers = ['ppapi/' + header_file for header_file in cpp_headers] |
| 25 |
| 26 # From ppapi_cpp.gypi:ppapi_cpp_objects:cpp/dev/[^/]*\.h |
| 27 cpp_dev_headers = gyp_extract.GypTargetSources( |
| 28 ppapi_cpp_gypi, 'ppapi_cpp_objects', 'cpp/dev/[^/]*\.h') |
| 29 cpp_dev_headers = ['ppapi/' + header_file for header_file in cpp_dev_headers] |
| 30 |
| 31 |
| 32 def EmitHeaderTest(target=None, source=None, env=None): |
| 33 fh = open(target[0].path, 'w') |
| 34 for header in env['TEST_HEADERS']: |
| 35 fh.write('#include "%s"\n' % header) |
| 36 fh.close() |
| 37 return 0 |
| 38 |
| 39 |
| 40 cpp_header_test_cc = env.Command( |
| 41 '$OBJ_ROOT/gen/native_client/test/ppapi/cpp_header_test.cc', |
| 42 [], Action(EmitHeaderTest, varlist=['TEST_HEADERS']), |
| 43 TEST_HEADERS=cpp_headers) |
| 44 |
| 45 cpp_dev_header_test_cc = env.Command( |
| 46 '$OBJ_ROOT/gen/native_client/test/ppapi/cpp_dev_header_test.cc', |
| 47 [], Action(EmitHeaderTest, varlist=['TEST_HEADERS']), |
| 48 TEST_HEADERS=cpp_dev_headers) |
| 49 |
| 50 |
14 ppapi_header_test_inputs = [ | 51 ppapi_header_test_inputs = [ |
15 'cpp_header_test.cc', | 52 cpp_header_test_cc, |
16 'cpp_dev_header_test.cc', | 53 cpp_dev_header_test_cc, |
17 'opengl_header_test.c', | 54 'opengl_header_test.c', |
18 'opengl_cpp_header_test.cc', | 55 'opengl_cpp_header_test.cc', |
19 ] | 56 ] |
20 | 57 |
21 # Build-only test to make sure the header layout for ppapi is correct. | 58 # Build-only test to make sure the header layout for ppapi is correct. |
22 | |
23 env.ComponentLibrary('header_test', ppapi_header_test_inputs) | 59 env.ComponentLibrary('header_test', ppapi_header_test_inputs) |
OLD | NEW |