Skip to content

Commit

Permalink
mlif: support ccache
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Sep 26, 2024
1 parent 9c9ef0e commit e61699f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mlonmcu/platform/mlif/mlif.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class MlifPlatform(CompilePlatform, TargetPlatform):
"fuse_ld": None,
"global_isel": False,
"extend_attrs": False,
"ccache": False,
}

REQUIRED = {"mlif.src_dir"}
Expand All @@ -119,6 +120,11 @@ def __init__(self, features=None, config=None):
def goal(self):
return self.config["goal"]

@property
def ccache(self):
value = self.config["ccache"]
return str2bool(value) if not isinstance(value, (bool, int)) else value

@property
def set_inputs(self):
value = self.config["set_inputs"]
Expand Down Expand Up @@ -431,6 +437,9 @@ def get_definitions(self):
definitions["STRIP_STRINGS"] = self.strip_strings
if self.unroll_loops is not None:
definitions["UNROLL_LOOPS"] = self.unroll_loops
if self.ccache:
definitions["CMAKE_C_COMPILER_LAUNCHER"] = "ccache" # TODO: choose between ccache/sccache
definitions["CMAKE_CXX_COMPILER_LAUNCHER"] = "ccache" # TODO: choose between ccache/sccache

return definitions

Expand Down

0 comments on commit e61699f

Please sign in to comment.