Replies: 3 comments 6 replies
-
Yeah, dependencies don't -- currently -- support language specific arguments. It is a long-term goal of @dcbaker to remove this limitation. It's still possible to have multiple dependencies, and split each group of source files into one convenience static_library per language, and add the matching dependencies to the matching convenience libraries. |
Beta Was this translation helpful? Give feedback.
-
Any progress in implementing separate C/C++ arguments to |
Beta Was this translation helpful? Give feedback.
-
FYI, this is the hack I had to use in my latest project to accommodate per language options (more or less the same as explained in the initial report). Alongside each dependency that I define, I also define two variables with the c & cpp args:
Later, when I have to include these dependencies, I manually collect these args too:
It is more or less functional, but it is far from ideal (to put it mildly). :-( |
Beta Was this translation helpful? Give feedback.
-
I created a package which builds Google Test as a static library, and, in order to pass the build in my environment which is not tolerant to warnings, I had to use quite a lot of
-Wno-*
compiler options to silence the countless warnings.My tests are built with gcc/clang/arm-none-eabi-gcc, on multiple platforms.
Due to the specifics of the toolchains, generally the options can be split into:
The way I implemented this looks like:
In other words, I keep three arrays with common/c/cpp options, and I concatenate pairs when passing them to
static_library()
.So far, so good.
However, when having to create the dependency object, I noticed that I can pass only one
compile_args
, not two, as for the library.I passed the common options, and stored the language specific options in global arrays, to be included explicitly by the applications depending on this library.
With this, the definition of an executable looks like this:
In other words, the executable refers to:
Is this how it is supposed to be?
I feel that either I missed something related to how dependencies should be defined in meson, or there is a small problem with the
declare_dependency()
signature.If I did not get it right, is there a documentation page which explains how it should be done properly?
Thank you,
Liviu
Beta Was this translation helpful? Give feedback.
All reactions