compiler_executables emulator key#19940
Conversation
| self.cross_build["build"]["subsystem"] = get_apple_subsystem(sdk_build) | ||
| # Issue: https://github.com/conan-io/conan/issues/19217 | ||
| self.properties["needs_exe_wrapper"] = not can_run(self._conanfile) | ||
| self.properties["needs_exe_wrapper"] = self.emulator is not None or not can_run(self._conanfile) |
There was a problem hiding this comment.
This is outside my knowledge, will let someone else weight in on it
franramirez688
left a comment
There was a problem hiding this comment.
It's looking great! I left a couple of comments to be discussed, basically:
- I think that we do not really need a public argument to define the wrapper, as any recipe should not define it via the generate() function.
- I think that the only change could be this https://github.com/conan-io/conan/pull/19940/changes#r3235881460
- Instead of
self._emulatoras an attribute in the toolchain, let's name itself._exe_wrapper. I think it's clearer.
| #: Defines the Meson ``objcpp_args`` variable. Defaulted to ``OBJCXXFLAGS`` build environment value | ||
| self.objcpp_args = [] | ||
| #: Defines the Meson ``objcpp_link_args`` variable. Defaulted to ``LDFLAGS`` build environment value | ||
| self.objcpp_link_args = [] |
There was a problem hiding this comment.
The only change to add could be something like:
#: Defines the Meson ``objcpp_link_args`` variable. Defaulted to ``LDFLAGS`` build environment value
self.objcpp_link_args = []
# Let's check if any emulator was defined
self._exe_wrapper = None
exe_wrapper = compilers_by_conf.get("emulator")
if native is False and is_cross_building and exe_wrapper:
self._exe_wrapper = exe_wrapper
self.properties["needs_exe_wrapper"] = TrueThere was a problem hiding this comment.
I understand, I've changed the property name.
And to avoid duplicating the if native is False and is_cross_building and exe_wrapper logic, I've moved the read of compilers_by_conf upper, so that we can maintain the needs_exe_wrapper logic wher it was
| # Read configuration for compilers | ||
| compilers_by_conf = self._conanfile_conf.get("tools.build:compiler_executables", default={}, | ||
| check_type=dict) | ||
| self.emulator = compilers_by_conf.get("emulator") |
There was a problem hiding this comment.
This is wrong as it's only used for cross-compiling and native=False. That's why I'm proposing this https://github.com/conan-io/conan/pull/19940/changes#r3235881460
memsharded
left a comment
There was a problem hiding this comment.
Does this have an equivalent for CMake? It would be good to see its application for CMake too.
Changelog: Feature:
compiler_executablesadmit newemulatorkey which can control Mesonexe_wrapperand CMakeCMAKE_CROSSCOMPILING_EMULATORDocs: TODO
Close #18718
Close #19912
Related PR: #19983
developbranch, documenting this one.