Skip to content
Discussion options

You must be logged in to vote

I don't think a package can reliably read the consuming target's set_languages() value directly.

set_languages() is target/option-level project configuration, while the package recipe is resolved in package context and may be reused by multiple targets with different language standards. In package scripts the documented interface is the package config API (package:config(...), package:configs()) plus explicit detection configs. The package detection helpers also take the standard explicitly, for example:

package:has_cxxfuncs("foo", {configs = {languages = "cxx17"}})
package:has_cxxsnippets("...", {configs = {languages = "c++20"}})

So for a package requirement I would make the C++ standard…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@poirierlouis
Comment options

Answer selected by poirierlouis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants