|
3 | 3 |
|
4 | 4 | CC_INFO = "CcInfo" |
5 | 5 |
|
| 6 | +def file_list_to_paths(files): |
| 7 | + return [getattr(f, "path", f) for f in files] |
| 8 | + |
6 | 9 | def compilation_context_to_struct(ctx): |
7 | 10 | return struct( |
8 | 11 | defines = ctx.defines.to_list(), |
9 | | - direct_headers = ctx.direct_headers, |
10 | | - direct_private_headers = ctx.direct_private_headers, |
11 | | - derect_textutal_headers = ctx.direct_textual_headers, |
| 12 | + headers = file_list_to_paths(ctx.headers.to_list()), |
| 13 | + direct_headers = file_list_to_paths(ctx.direct_headers), |
| 14 | + direct_private_headers = file_list_to_paths(ctx.direct_private_headers), |
| 15 | + derect_textutal_headers = file_list_to_paths(ctx.direct_textual_headers), |
12 | 16 | external_includes = ctx.external_includes.to_list(), |
13 | 17 | framework_includes = ctx.framework_includes.to_list(), |
14 | 18 | includes = ctx.includes.to_list(), |
@@ -40,7 +44,7 @@ def format_cc_info(info): |
40 | 44 | def format(target): |
41 | 45 | buffer = "%s: " % target.label |
42 | 46 |
|
43 | | - if CC_INFO in providers(target): |
| 47 | + if CC_INFO in (providers(target) or []): |
44 | 48 | buffer += format_cc_info(providers(target)[CC_INFO]) |
45 | 49 | else: |
46 | 50 | buffer += "NO CcInfo" |
|
0 commit comments