Skip to content

Commit 6686411

Browse files
committed
Set vpath correctly when exporting to projectfiles directory
1 parent 2196d50 commit 6686411

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tools/export/gccarm.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17-
from exporters import Exporter
18-
from os.path import splitext, basename, relpath, join, abspath
17+
from os.path import splitext, basename, relpath, join, abspath, dirname
1918
from os import curdir, getcwd
19+
from tools.export.exporters import Exporter
2020

2121

2222
class GccArm(Exporter):
@@ -150,7 +150,6 @@ def generate(self):
150150
l, _ = splitext(basename(lib))
151151
libraries.append(l[3:])
152152

153-
build_dir = abspath(join(self.export_dir, ".build"))
154153
ctx = {
155154
'name': self.project_name,
156155
'to_be_compiled': to_be_compiled,
@@ -162,7 +161,9 @@ def generate(self):
162161
'symbols': self.toolchain.get_symbols(),
163162
'cpu_flags': self.toolchain.cpu,
164163
'hex_files': self.resources.hex_files,
165-
'vpath': [".."]
164+
'vpath': (["../../.."]
165+
if basename(dirname(dirname(self.export_dir))) == "projectfiles"
166+
else [".."])
166167
}
167168

168169
for key in ['include_paths', 'library_paths', 'linker_script', 'hex_files']:
@@ -174,7 +175,3 @@ def generate(self):
174175
ctx["include_paths"] += ['../.']
175176
ctx.update(self.flags)
176177
self.gen_file('gcc_arm_%s.tmpl' % self.target.lower(), ctx, 'Makefile')
177-
178-
def scan_and_copy_resources(self, prj_paths, trg_path, relative=False):
179-
self.prj_paths = prj_paths
180-
Exporter.scan_and_copy_resources(self, prj_paths, trg_path, relative)

0 commit comments

Comments
 (0)