Git Product home page Git Product logo

Comments (4)

jpakkane avatar jpakkane commented on May 29, 2024

It seems like you have a dependency library that you are trying to use. It is very strongly recommended that you provide a pkg-config file for that so then you can do this

foodep = dependency('yourlibrary')
executable( ..., dependencies : foodep)

If this is not possible for you, then you can set the flags manually by something like this:

custom_incs = include_directories('prefix/include', ... , '/usr/local/include')
executable(...,
 include_directories : custom_incs,
link_args : '-L/usr/local/lib')

Note that you don't need to set /usr/include to include path or /usr/lib to library path. They are provided by your compiler's default settings.

from meson.

cxj avatar cxj commented on May 29, 2024

Thank you for the suggestions. We don't use packages at all, at the moment. In fact, both ${PREFIX}/include and ${PREFIX}/lib are install targets for the ${PREFIX}/src/lib parts of the repository. So we have dependency rules to insure they are built first before each app which depends on them is built. Right now, it's all in done in BSD Make, but I'd sure like to use a better tool, like Meson! :-)

from meson.

jpakkane avatar jpakkane commented on May 29, 2024

If you are linking against libraries that you build yourself, you really don't need to deal with linker flags or anything like that.

Say you are in subsystem/lib and do sublib = shared_library(...). Then when you get to some/other/dir you just do executable('myexe', ..., link_with : sublib). Meson will automatically:

  • take care of linker flags
  • take care of dependencies
  • set up rpath so you can run myexe directly from the build dir without fiddling with LD_LIBRARY_PATH or something similar
  • unset all this magic when you do "ninja install"

from meson.

jpakkane avatar jpakkane commented on May 29, 2024

The questions raised in this bug seem to be answered so closing. If you have more questions or clarifications, feel free to reopen this bug or file a new one.

from meson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.