Comments (4)
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.
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.
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.
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)
- Vulkan detection fails on msys build HOT 2
- Finding Qt6 in Cross-Compilation Setup HOT 2
- bug: pulseaudio cannot be built as a souce from apt on ubuntu 24.04 HOT 1
- compiler.has_argument() does not support gcc -Wno-attributes=
- Vala C code started printing warnings on 1.4.0 HOT 4
- [Feature Request]: Add built-in option(s) to simplify hardening binaries HOT 5
- Dlang: D compilers can also consume *.i files as sources
- compiler.get_define result is incorrectly cached
- Unity builds should allow excluding files from units HOT 5
- Compiling a project with SDL2 using SDL2 repo instead of wrapdb
- Linker detection uses compiler binary even when <lang>_ld flag option is specified
- Custom manifest does not work with VS backend HOT 3
- /home/MesonBuild/meson: not found during Generating symbol file HOT 2
- Feature request: initialize env object from another env HOT 3
- Relative rpaths are used for a pkgconfig dependency on Linux HOT 1
- additional options to wx-config for wxwidgets dependency HOT 1
- cmake `check_c_source_compiles` fails while finding deps when `c` binary is a list of strings HOT 6
- Meson does not correctly handle `ifx` when linking to an external library HOT 2
- Unknown method "name" in object <[ExternalLibraryHolder] holds [ExternalLibrary]: <ExternalL ibrary m: True>> of type ExternalLibraryHolder HOT 1
- CosmoCC compiler components not detected as executable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meson.