c.linklibraries on a library

Added by Kevin Thacker over 5 years ago

if I specify libraries (with C.LinkLibraries) for another library (C.Library) the libraries don't seem to be linked into the final exe/dll.
This means "I want this other library to be linked" when I link this library.

Is this behaviour expected?

C.LinkLibraries MYLIB : anotherlib ;

C.Library MYLIB : $(MYLIBFILES) ;

then...

C.LinkLibraries MYAPP : MYLIB ;
C.Application MYAPP : $(MYAPPFILES) ;

When MYLIB is linked, it doesn't appear to find the libraries defined on MYLIB.

This behaviour is allowed by Visual Studio.


Replies (3)

RE: c.linklibraries on a library - Added by Joshua Jensen over 5 years ago

Right now, C.LinkLibraries only applies to the executable.

I've been playing around in Visual Studio to see what its behavior is and determine what the JamPlus behavior should be.

Here is what I think you are asking for:

# When MyProject is linked by the application, SharedProject should be added to the application's link line.
C.LinkLibraries MyProject : SharedProject ;

# MyApplication is linking MyProject, so it implicitly needs SharedProject, too.
C.LinkLibraries MyApplication : MyProject ;

To achieve the above scenario in the current JamPlus, you have to do this:

C.LinkLibraries MyApplication : MyProject SharedProject ;

Is this what you are thinking?

-Josh

RE: c.linklibraries on a library - Added by Kevin Thacker over 5 years ago

yes this is what I was thinking.

RE: c.linklibraries on a library - Added by Joshua Jensen over 5 years ago

Okay. I can look at adding this sometime soon.

-Josh

(1-3/3)