Wednesday, December 13th 2017, 7:58am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

pmendham

Beginner

Date of registration: Jan 17th 2017

Posts: 4

1

Tuesday, January 17th 2017, 1:28pm

Ozone - finding sources for ELF which references static libraries

Dear all,

I have a project which builds to an ELF file and which uses multiple static libraries. Within the project itself, and the libraries, the source tree is heavily nested. Because each library is built by itself (using recursive make), the file paths recorded in the final ELF are all relative. So, for example, a sources file will have its path recorded as "src/a/b/file.c". That path is relative to the root directory for one of the libraries, but the ELF file does not record which one. Each library is standalone and is used by multiple projects, so this structure has been working well for us for a number of years.

If, in Ozone, I use Project.SetRootPath to set the root path to one of the libraries, Ozone will immediately find all of the source files in that library. However, it will only find the source files in that library. If I set the root path again, to a different library, if now will only find the source in the second library. If I use Project.AddSearchPath to add the root directory for the library to the Ozone search path then it will find none of the library source or header files. I believe this is because, for the root path, Ozone respects the relative path of each file and appends it to the specified root path; whereas, for the search path, Ozone ignores relative paths. I think this means that, for every subdirectory in every library we use (there are hundreds) we must add the directory to the search path. That means that if we make a small change to the structure of one the libraries we must update the search path directories in the Ozone project file. In fact, given how many directories there are, I need to write a script to create the Ozone project file in the first place.

Is this really the case? Is there a better solution?

Many thanks in advance,

Peter

pmendham

Beginner

Date of registration: Jan 17th 2017

Posts: 4

2

Tuesday, January 17th 2017, 3:25pm

Example jdebug file for project with library dependencies

Further to my question above, I created a .jdebug file which specifies all of the necessary search paths individually. I have attached an example below (I renamed the file to allow me to attach it). Ozone will not load this project now (it hangs). I'm guessing that there are too many search paths. Are there any suggestions for solving this issue?

Thanks in advance,

Peter
pmendham has attached the following file:
  • example_jdebug.txt (37.67 kB - 191 times downloaded - Last download: Dec 7th 2017, 1:33pm)

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 365

3

Friday, January 20th 2017, 10:41am

Hi,

With V2.22m, which is available now, there is a new command Project.AddRootPath(), which you can use to set the root paths of your libraries.

Best regards
Johannes

pmendham

Beginner

Date of registration: Jan 17th 2017

Posts: 4

4

Friday, January 20th 2017, 2:20pm

Hi Johannes,

That's fantastic, thank you! I'll give that a try.

Best regards,

Peter

pmendham

Beginner

Date of registration: Jan 17th 2017

Posts: 4

5

Friday, January 20th 2017, 5:50pm

Issue Closed

I can confirm that Project.AddRootPath() works well. Thank you for your prompt response.

Best regards,
Peter

Similar threads