Boost-bjam: link result with precompiled library

2019-08-05 06:43发布

问题:

What should I put into my jamroot.jam file so that libAPLibrary.so is linked with the result of MyProject compilation?

root
  |-MyProject
  |   |-jamroot.jam
  |
  |-AnotherProject
      |-lib
          |-libAPLibrary.so 

回答1:

if the library libAPLibrary.so is already compiled one you should declare it and the link it against the project, this way:

lib libAPLibrary : : 
    # watch out for empty spaces, they are mandatory
    <file>../AnotherProject/lib/libAPLibrary.so ;

exe MyProject
    : 
        # your project sources here
        # this is a generic filter but you 
        # can replace it with file names
        [ glob *.c* ] 

        # external libraries
        libAPLibrary
;