(header_file, compiler)
| 117 | |
| 118 | |
| 119 | def check_header(header_file, compiler): |
| 120 | test_c_file = '%s/test.c' % DEPS_DIR |
| 121 | test_o_file = '%s/test.o' % DEPS_DIR |
| 122 | |
| 123 | src = """ |
| 124 | #include <%s> |
| 125 | |
| 126 | int main() |
| 127 | { |
| 128 | return 0; |
| 129 | } |
| 130 | """ % header_file |
| 131 | |
| 132 | try: |
| 133 | with open(test_c_file, 'w') as fp: |
| 134 | fp.write(textwrap.dedent(src)) |
| 135 | |
| 136 | return cmd_success('%s %s -c %s -o %s' % |
| 137 | (compiler, ' '.join(cxx_flags), test_c_file, |
| 138 | test_o_file)) |
| 139 | |
| 140 | finally: |
| 141 | cmd('rm -f %s %s' % (test_c_file, test_o_file), quiet=True) |
| 142 | |
| 143 | |
| 144 | def check_c_lib(lib): |
no test coverage detected