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.
pull/1621/head
0xc0170 2016-03-02 10:29:30 +01:00 committed by adustm
parent a4586f1f51
commit bc48d73db3
1 changed files with 4 additions and 1 deletions

View File

@ -62,7 +62,7 @@ class Exporter(object):
self.resources.objects + self.resources.libraries, self.resources.objects + self.resources.libraries,
}, },
'includes': { 'includes': {
'Include Files': self.resources.headers + self.resources.inc_dirs, 'Include Files': self.resources.headers,
}, },
'target': [TARGET_MAP[self.target].progen['target']], 'target': [TARGET_MAP[self.target].progen['target']],
'macros': self.get_symbols(), 'macros': self.get_symbols(),
@ -76,6 +76,9 @@ class Exporter(object):
"""" Generate project using ProGen Project API """ """" Generate project using ProGen Project API """
settings = ProjectSettings() settings = ProjectSettings()
project = Project(self.program_name, [project_data], settings) project = Project(self.program_name, [project_data], settings)
# TODO: Fix this, the inc_dirs are not valid (our scripts copy files), therefore progen
# thinks it is not dict but a file, and adds them to workspace.
project.project['common']['include_paths'] = self.resources.inc_dirs
project.generate(tool_name, copied=True) project.generate(tool_name, copied=True)
def __scan_all(self, path): def __scan_all(self, path):