I've got a library (Google's protobuf, FWIW) which requires a certain compile-time flag if it's been built into a shared library. However, if it's been built into a static library, then it mustn't have the flag.
pkg-config files have a Cflags property, which contains the cflags an application should use when using both the static and shared version of the library, and a Cflags.private property, which is only for static libraries.
Cflags: -DUSED_FOR_BOTH
Cflags.private: -DUSED_ONLY_FOR_STATIC
But I can't find a property which is only applied to shared libraries --- i.e. somewhere where I'd put the -DUSED_ONLY_FOR_SHARED. Have I missed something, or is this simply not doable?
$ pkg-config -cflags -libs protobufoutputs-lprotobufand$ pkg-config -cflags -libs -static protobufoutputs-lprotobuf -lz. So it's unclear why you say thatprotobuf"requires a certain compile-time flag if it's been built into a shared library. However, if it's been built into a static library, then it mustn't have the flag." Best if you describe your problem concretely..pcfile syntax, not protobuf.