Bug #34

Platform-conditional C.LinkLibraries

Added by Eugene Khvedchenya about 9 years ago. Updated about 9 years ago.

Status:NewStart date:01/04/2011
Priority:NormalDue date:
Assignee:-% Done:


Target version:old-snapshots


I'm using Jamplus for cross-platform build system (for now only for win32 and and macosx).
Depending on the platform i want to use different projects in my target application project.
I'm doing it like this (http://jamplus.org/git/jamplus/docs/html/module_c.html#rule_C_LinkLibraries):

// Assuming i've declared ActiveProject above:
C.LinkLibraries : iPhoneBind : : iphone iphonesimulator ;
C.LinkLibraries : win32bind : : win32 ;

Project generation stage is ok (for windows platform i see the win32bind project in my solution, the same for xcode there are iPhoneBind in workspace), but i'm experiencing the problem on linking stage.
Looks like the dependent project is not build (I can assume it's not included in dependency graph for target application).
The iPhoneBind/win32bind projects won't compile (no .lib/.a file created) and it's missing from linker input at all.

JampulsLinkLibrariesIssueExample.zip (1.07 MB) Eugene Khvedchenya, 01/06/2011 10:50 AM


#1 Updated by Eugene Khvedchenya about 9 years ago

The whole Jamfile can look like this:

ActiveProject ExampleApp01 ;
C.LinkLibraries : lib1 lib2 lib3 ;

if ( $(OS) = MACOSX )
  C.LinkLibraries : iPhoneBind : : iphone iphonesimulator ;

if ( $(OS) = NT )
  C.LinkLibraries : win32bind : : win32 ;

The if clauses are required to disable compilation iPhoneBind for win32 platform and vice versa.
In such case binds are never compile and link.

#2 Updated by Joshua Jensen about 9 years ago

I just tested C.LinkLibraries with the platform specified as the fourth parameter. It linked without issue.

Can you provide a more complete sample of it failing? I'd like to get the problem fixed.


#3 Updated by Eugene Khvedchenya about 9 years ago

Hi Joshua!
Here is attachment with test project. One application (DemoApp) and two static platform-dependent libraries (one for win32 - called LibWin32, one for iphone - called LibiOS).

It demonstrate at least one problem:
When targeting to iphone/iphone simulator platform, the LibWin32 project tried to build. Actually i is'n involved in link stage of the DemoApp, but generates compilation errors.
Is such behavior (build ALL targets including non used by current platform) expected?

Also available in: Atom PDF