11-09-2020 07:23 AM - edited 11-11-2020 12:40 AM
In Vitis 2020.1 i have created a system project, which contains two application projects named project A and project B.
The two application projects are very similar in functionaility, and therefore I want to share some c-source and header files from project A, which shall be used in project B. There shall only exist one source /header file for both projects.
Currently all source files are located in project A (T:\V2.1\vitis\HDMI_TX1\src). I have imported the source files which shall be shared by using the option "Create links in workspace" as depicted below:
Well the shared source files appears now in project B (T:\V2.1\vitis\HDMI_TX2\src) with the link symbol in the lower right corner.
When I change the file in project B, the file is also changed in project A. This is exaclty what I'm looking for. So far so good !
But when I start compiling project B, the compiler complains, that it is not able to find the header file "axi_gpio.h", although it is visible as linked source file in the soruce folder of Project B.
What else do I have to do to get it running?
11-11-2020 01:09 AM
found the answer for my question on my own. Somebody in the forum had a similar issue with SDK. You still have to add the source path for the linked source files in C/C++ Build->Settings->Directories->IncludePath.
Here is the solution, which works also for VITIS.
11-16-2020 03:33 AM - edited 11-16-2020 04:40 AM
actually I thought that I have found a the solution for my problem, but I was wrong !
When I include a path in project B, which points to the source files of project A (HDMI_TX1), then I'm able to compile project B properly, but then project A is no longer compiling !!!
In project A, I get a problem a problem with a Xparameter define, which is no longer found, although the xparameter.h file is visible in the bsp of project A!
How can this be? Project A compiles properly, as long as the path in project B is not included. It is strange that a setting in project B influences the compilation of project A
Can anybody help?
11-16-2020 05:07 AM
11-17-2020 12:38 AM
thank you for this advice.
If I follow your suggestion, then I will link all files which are in the src folder of project A. But I do not want to link all source files from project A to project B. I only want to link some files.
Well I could split up the source files in shared sources and non-shared sources, by putting them into two different folders, for example a src/non_shared and a src/shared folder. By this way you could just link the shared sources as you suggested. But then I need to know what else have to be done, in order to support two differnt source folders. I assume there must be added some paths in the build settings?
Well it could be an option, but first I want to wait for an official answer from Xilinx how to work with shared source files. So far I didn't get any response...
11-17-2020 04:47 AM
You can still do this on per-file basis with links.
Sometimes, even if the tool provides a solution (as you pointed out and tried), it's not as good as just using tools provided by the OS...
I hope they respond.
11-17-2020 06:31 AM
[Olupj wrote] Sometimes, even if the tool provides a solution (as you pointed out and tried), it's not as good as just using tools provided by the OS...
Not only sometimes