conan
conan copied to clipboard
investigating consumer flags per compiler
Changelog: (Feature | Fix | Bugfix): Describe here your pull request Docs: https://github.com/conan-io/docs/pull/XXXX
Close https://github.com/conan-io/conan/issues/18613
A ConanCenter recipe would look like:
#if is_msvc(self):
# Required for the __cplusplus check at
# https://github.com/DCMTK/dcmtk/blob/DCMTK-3.6.8/config/include/dcmtk/config/osconfig.h.in#L1489
# self.cpp_info.components[target_lib].cxxflags.append("/Zc:__cplusplus")
def myflags(consumer):
if consumer.settings.get_safe("compiler") == "msvc":
return ["/Zc:__cplusplus"]
self.cpp_info.components[target_lib].cxxflags = myflags
With new changes, the recipe in ConanCenter could be just:
self.cpp_info.cxxflags = lambda c: ["/Zc:__cplusplus"] if is_msvc(c) else []
And fully transparent to the consumers