1

I'm building a library for which one file requires an additional include path. Is there a way to adjust the include path for compilation of a single file?

     bld(features="cxx cxxshlib",
         source=[so, many, files, from an ant_glob],
         includes=[Some path that's really only needed for one interface file])

I'd be happy with a solution that is use based, too.

Ken White
  • 123,280
  • 14
  • 225
  • 444
dbn
  • 13,144
  • 3
  • 60
  • 86

2 Answers2

0

I think most solutions will be more lines of code than just compiling your one file separately.

0

You need to compile the specfic file by using objects and then use the result.

Something like this:

def build(bld):
    # build the specfifc object
    bld.objects(source="foo.cpp", includess="path/to/directory", target="foo")
    # build the library and include that object file using 'use='
    bld.stlib(source='bla.cpp blu.cpp', includes="this/path that/path", target='mylibrary', use='foo') 
user69453
  • 1,279
  • 1
  • 17
  • 43
  • When I do this, the per-object use is skipped at the link step – dbn May 04 '23 at 16:49
  • If you don't link with the library, you need to use the ``use`` keyword and the object file to used as argument in your linking step also. – user69453 May 05 '23 at 18:55