Skip to content

How to get project()'s language? #14126

Answered by eli-schwartz
Freed-Wu asked this question in Q&A
Discussion options

You must be logged in to vote

The add_languages() function is equivalent to specifying in the project() definition but is usually used for doing conditional language addition. You can use it here to reduce duplication as well:

project('foo')

languages = ['foo', 'bar']
add_languages(languages, required: true)

You can then use the languages variable again for other purposes.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Freed-Wu
Comment options

@eli-schwartz
Comment options

Answer selected by Freed-Wu
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