Skip to content

Commit

Permalink
Correctly format include paths for eclipse export
Browse files Browse the repository at this point in the history
Eclipse CDT expects the include paths to include the project name like '/<project>/<include-path>' for workspace include directories.
See issue ARMmbed#3529.
  • Loading branch information
bittailor committed Jan 5, 2017
1 parent e7361eb commit b668185
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/export/cdt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import re

from os.path import join, exists, realpath, relpath, basename
from os import makedirs

Expand All @@ -12,13 +14,14 @@ def generate(self):
py_ocd_settings launch file, and software link .p2f file
"""
super(Eclipse, self).generate()
include_paths_replace_re= re.compile(r'(^[.]/|^[.]$)')
ctx = {
'name': self.project_name,
'elf_location': join('BUILD',self.project_name)+'.elf',
'c_symbols': self.toolchain.get_symbols(),
'asm_symbols': self.toolchain.get_symbols(True),
'target': self.target,
'include_paths': self.resources.inc_dirs,
'include_paths': map(lambda s: include_paths_replace_re.sub('%s/' % self.project_name, s), self.resources.inc_dirs),
'load_exe': str(self.LOAD_EXE).lower()
}

Expand Down

0 comments on commit b668185

Please sign in to comment.