Open ubitux opened 3 years ago
I think this is a specific case of: https://github.com/mesonbuild/meson/issues/6361
The new MacOS for arm64 is worth mentioning.
+1 on this. Right now, both M1-based macs (arm64) and iOS devices have:
[host_machine]
system = 'darwin'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
This makes it unpractical to distinguish between them, and forces the user to rely on hacks like @ubitux described.
Any progress on this or #6361? Assuming not, what is the best practice way of specifying macos vs ios in your meson.build files? It looks like deep inside meson https://github.com/mesonbuild/meson/blob/4f4076bfc0dacbc5f804ad2d970054ab43d162b3/mesonbuild/envconfig.py#L309 there's a system check for 'darwin', 'ios', and 'tvos' but does that get out in the host_machine.system() call? I assume not since it's not in the reference table. It also looks like inside meson there's a lib check for UIKit as the ios vs macos test https://github.com/mesonbuild/meson/blob/59d4f771d280cbea0d0afc9579e127225751c028/test%20cases/osx/4%20framework/meson.build#L17 (edit: I didn't notice this was in a test script when I posted this, not meson main) which seems kinda hacky, but I guess works at least for tvos and ios. I guess for now I'll make a global darwin_type string at the top of the main meson file? Or go all the way to host_machine_system_flavor and have it deal with android abis and linux distros and stuff, under the assumption that host_machine.flavor() will happen at some point? What's the best practice here?
Thanks, Chris
Describe the bug
The
darwin
system identifier is shared betweenmacOS
andiOS
(and othertvOS
etc). Since frameworks typically differ between those, it is common to manually detect the OS with code such as:Details on the
TARGET_OS_*
:Source: https://github.com/mstg/iOS-full-sdk/blob/master/iPhoneOS9.3.sdk/usr/include/TargetConditionals.h
Could we have a more specific value returned by
host_machine.system()
?Or maybe some sort of flavor/distrib method? We would typically have
system='darwin'
andflavor={'ios','tv','watch',...}
. On Linux it could besystem='linux'
andflavor={'debian','ubuntu','fedora','centos',...}