Conditional compilation #12813
Replies: 4 comments 1 reply
-
Environment variables are just options, except that meson cannot track the persistent state of the options. If you check an environment variable and then edit meson.build and For some environment variables, like |
Beta Was this translation helpful? Give feedback.
-
It's possible to check an environment variable regardless, using is_set = run_command('check_environment.py', 'VARNAME', check: true).stdout().strip() == 'set'
platform = run_command('check_environment_value.py', 'VARNAME', check: true).stdout().strip() or similar. This is stepping outside of the meson DSL, which means it depends on you guaranteeing the environment variable is always set when you need it to be. |
Beta Was this translation helpful? Give feedback.
-
Ok thank you for your quick reply! But what's the way to do using meson? Do i really have to add a meson.option file to each project? |
Beta Was this translation helpful? Give feedback.
-
Thank your for answer! Using meson 1.3.0 we are able to use
So this solved our problems! |
Beta Was this translation helpful? Give feedback.
-
Hi *!
We are trying switching our buildsystem to "meson". We have different "platforms" where we wanna compile different source files!
E.g.: project(common)
My idea was, to decide this using an environment variable! -> but i have not found a way to access (get) environment variable! Set/Append is supported - why no 'get'?
I know i could use "options" ... but then i have to define an options file in each of our projects (about 40 projects). Using environment variable would we much easier (also in CLION IDE environment files are supported)
I hope i've described my "problem" so that my intention is clear!
Thank you very much,
Martin
Beta Was this translation helpful? Give feedback.
All reactions