Skip to content

Commit 38f4c1d

Browse files
committed
Exporter - progen include dirs fix
mbed scripts copy files, therefore file paths are not valid at the moment of ahe project generation. Therefore checks like os.path.isdir or isfile fail. If include is set to TARGET/FOLDER, this would be treated as a file, and added to the project workspace. This commit fixes it, it adds dirs only to include_paths, as it should.
1 parent 2b8c9ef commit 38f4c1d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

workspace_tools/export/exporters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def progen_get_project_data(self):
6262
self.resources.objects + self.resources.libraries,
6363
},
6464
'includes': {
65-
'Include Files': self.resources.headers + self.resources.inc_dirs,
65+
'Include Files': self.resources.headers,
6666
},
6767
'target': [TARGET_MAP[self.target].progen['target']],
6868
'macros': self.get_symbols(),
@@ -76,6 +76,9 @@ def progen_gen_file(self, tool_name, project_data):
7676
"""" Generate project using ProGen Project API """
7777
settings = ProjectSettings()
7878
project = Project(self.program_name, [project_data], settings)
79+
# TODO: Fix this, the inc_dirs are not valid (our scripts copy files), therefore progen
80+
# thinks it is not dict but a file, and adds them to workspace.
81+
project.project['common']['include_paths'] = self.resources.inc_dirs
7982
project.generate(tool_name, copied=True)
8083

8184
def __scan_all(self, path):

0 commit comments

Comments
 (0)