New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: add preprocessor_definitions to Meson + CC/CXX from build requirements #8353
Fix: add preprocessor_definitions to Meson + CC/CXX from build requirements #8353
Conversation
Signed-off-by: SSE4 <tomskside@gmail.com>
blocked by #8311 |
Signed-off-by: SSE4 <tomskside@gmail.com>
@memsharded @SSE4 I updated the PR to use the new environment model. Check if the changes are correct and respond to the requested in the #8311 |
@@ -71,8 +74,44 @@ def __init__(self, conanfile, env=os.environ): | |||
self._cppstd = cppstd_from_settings(self._conanfile.settings) | |||
self._shared = self._conanfile.options.get_safe("shared") | |||
self._fpic = self._conanfile.options.get_safe("fPIC") | |||
self._build_env = VirtualEnv(self._conanfile).build_environment() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have merged this PR, because it is already an improvement.
But this is a bit "hardcoded". The VirtualEnv
might be used in generate()
in a different way, to customize what gets pulled into the environment, and users might prioritize dependencies, [conf], environment, or other stuff, but that will not be taken into account here.
It seems the ideal is that the MesonToolchain could use the conanbuildenv.xx
script, or some other way to reuse the build environment. But I ignore how Meson works for this, I guess the activation of conanbuildenv.xx
is still necessary?
Changelog: Fix: The new
MesonToolchain
now takes the declared environment variables (CC
,CXX
...) from build-requires and profiles to set the variablesc
,cpp
,c_ld
,cpp_ld
etc, into theconan_meson_native.ini
Changelog: Fix: Added new
preprocessor_definitions
to new Meson build helper.Changelog: Fix: The new
MesonToolchain
now allows adjusting any variable before generating theconan_meson_native.ini
file.Docs: conan-io/docs#2139
Closes #8311
this is mostly to align interface with
CMake
,Make
andMSBuild
(feature parity)important side change:
c_args
,c_link_args
,cpp_args
andcpp_link_args
are now arrays as documented at https://mesonbuild.com/Builtin-options.html#compiler-options: