Chromium Code Reviews| 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 re | |
| 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 | |
| 18 # Load ppapi_cpp.gypi | |
| 19 ppapi_cpp_gypi_filename = env.File('#/../ppapi/ppapi_cpp.gypi').path | |
| 20 ppapi_cpp_gypi = eval(open(ppapi_cpp_gypi_filename).read()) | |
|
Mark Seaborn
2011/03/22 01:17:27
Ditto.
| |
| 21 # Extract ppapi_cpp + ppapi_cpp_objects. | |
| 22 ppapi_cpp_objects = [t for t in ppapi_cpp_gypi['targets'] | |
| 23 if t['target_name'] == 'ppapi_cpp_objects'][0] | |
| 24 | |
| 25 # From ppapi_cpp.gypi:ppapi_cpp_objects:cpp/[^/]*\.h | |
| 26 cpp_headers = ['ppapi/' + s for s in ppapi_cpp_objects['sources'] | |
| 27 if re.match('^cpp/[^/]*\.h$', s)] | |
|
Mark Seaborn
2011/03/22 01:17:27
Indentation is off.
| |
| 28 | |
| 29 # From ppapi_cpp.gypi:ppapi_cpp_objects:cpp/dev/[^/]*\.h | |
| 30 cpp_dev_headers = ['ppapi/' + s for s in ppapi_cpp_objects['sources'] | |
| 31 if re.match('^cpp/dev/[^/]*\.h$', s)] | |
| 32 | |
| 33 def EmitHeaderTest(target=None, source=None, env=None): | |
| 34 fh = open(target[0].path, 'w') | |
| 35 for header in env['TEST_HEADERS']: | |
| 36 fh.write('#include "%s"\n' % header) | |
| 37 fh.close() | |
| 38 return 0 | |
| 39 | |
| 40 | |
| 41 cpp_header_test_cc = env.Command( | |
| 42 '$OBJ_ROOT/gen/native_client/test/ppapi/cpp_header_test.cc', | |
| 43 [], Action(EmitHeaderTest, varlist=['TEST_HEADERS']), | |
| 44 TEST_HEADERS=cpp_headers) | |
| 45 | |
| 46 cpp_dev_header_test_cc = env.Command( | |
| 47 '$OBJ_ROOT/gen/native_client/test/ppapi/cpp_dev_header_test.cc', | |
| 48 [], Action(EmitHeaderTest, varlist=['TEST_HEADERS']), | |
| 49 TEST_HEADERS=cpp_dev_headers) | |
| 50 | |
| 51 | |
| 14 ppapi_header_test_inputs = [ | 52 ppapi_header_test_inputs = [ |
| 15 'cpp_header_test.cc', | 53 cpp_header_test_cc, |
| 16 'cpp_dev_header_test.cc', | 54 cpp_dev_header_test_cc, |
| 17 'opengl_header_test.c', | 55 'opengl_header_test.c', |
| 18 'opengl_cpp_header_test.cc', | 56 'opengl_cpp_header_test.cc', |
| 19 ] | 57 ] |
| 20 | 58 |
| 21 # Build-only test to make sure the header layout for ppapi is correct. | 59 # Build-only test to make sure the header layout for ppapi is correct. |
| 22 | |
| 23 env.ComponentLibrary('header_test', ppapi_header_test_inputs) | 60 env.ComponentLibrary('header_test', ppapi_header_test_inputs) |
| OLD | NEW |