xmake outputs wrong relative path to files with errors

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
jorsc
Member++
Posts: 21
Joined: Fri May 05, 2017 1:39 pm

xmake outputs wrong relative path to files with errors

Post by jorsc »

Hello,
I can't figure this out.

If I have a project structure like this:
MyProject/
|-Makefile
|-src/main.xc
I then set my cwd in MyProject/ and run xmake. With no errors, the project is builds fine.
However if my main.xc has en error. The error is refer to main.xc as "../src/main.xc:7:2: error: <some error>"

Clearly the "../src/main.xc" does not refer to the correct path from where I have my cwd.

I also noticed that whenever I have library dependencies, they will refer to error with absolute paths and is thus OK.
Is there some way I can force xmake to always output absolute paths?

I have looked and looked in the command line manual but can't find any option that resolves this.


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi. Perhaps the following thread will help:

https://www.xcore.com/viewtopic.php?t=234
jorsc
Member++
Posts: 21
Joined: Fri May 05, 2017 1:39 pm

Post by jorsc »

Thanks, it seems that specifying the SOURCE_DIRS and INCLUDE_DIRS variables does help.
Unfortunately I then get other build issues.
Like this for every file:

Code: Select all

warning: ignoring old commands for target `.build_Release/import/lib_dsp/src/fft/dsp_fft_inverse.S.pca.xml.decouple
And an error:

Code: Select all

xcc: error: multiple xn source files supplied (".././src/XU216-512-TQ128-C20.xn") and (".././src/XU216-512-TQ128-C20.xn")
As a workaround I came up with this solution (using sed to substitute ../src to ./src):

Code: Select all

xmake 2>&1 | sed -E 's/\.\.\/src/\.\/src/g'
..a bit ugly but works for now.
Post Reply