Skip to content

Commit 9c838f4

Browse files
committed
Safer header export + cutekit 11.
1 parent 4346bc3 commit 9c838f4

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

cutekit/builder.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,25 @@ def _computeCinc(scope: TargetScope) -> list[str]:
153153
res.add(includeGenerated)
154154

155155
for c in scope.registry.iterEnabled(scope.target):
156-
if "cpp-root-include" in c.props:
157-
res.add(c.dirname())
156+
if "export-headers" in c.props:
157+
exportHeader = c.props["export-headers"]
158+
headerPath = Path(c.dirname()) / exportHeader
159+
if not headerPath.is_dir():
160+
_logger.warning(
161+
f"Component {c.id} export-headers path '{headerPath}' is not a directory"
162+
)
163+
continue
164+
res.add(str(headerPath.resolve()))
165+
166+
# TODO: Remove when we get 1.0 (will probably be forgotten anyway :^) )
167+
elif "cpp-root-include" in c.props:
168+
_logger.warning(
169+
f"Component {c.id} uses no longer supported 'cpp-root-include' property, use 'export-headers' instead"
170+
)
158171
elif "cpp-excluded" in c.props:
159-
pass
160-
elif c.type == model.Kind.LIB:
161-
res.add(str(Path(c.dirname()).parent))
172+
_logger.warning(
173+
f"Component {c.id} uses no longer supported 'cpp-excluded' that is no longer needed"
174+
)
162175

163176
incs = sorted(map(lambda i: f"-I{i}", res))
164177
if scope.target.props["host"] and platform.system() == "Darwin":

cutekit/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __bool__(self):
1414
raise Exception("Uninitialized constant")
1515

1616

17-
VERSION = (0, 10, 8)
17+
VERSION = (0, 11, 0)
1818
VERSION_STR = f"{VERSION[0]}.{VERSION[1]}.{VERSION[2]}{'-' + str(VERSION[-1]) if len(VERSION) > 3 else ''}"
1919
MODULE_DIR = os.path.dirname(os.path.realpath(__file__))
2020

0 commit comments

Comments
 (0)