From f9d410f5b13a3928815de8f69d85f0bd77a82cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Tue, 30 Apr 2024 11:23:17 +0200 Subject: [PATCH] meson: Simplify by using host_machine.subsystem() Available in newer versions of Meson. --- meson.build | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/meson.build b/meson.build index 0d6c661e0..0e90e2417 100644 --- a/meson.build +++ b/meson.build @@ -22,12 +22,8 @@ endif api_version = '1.0' -host_os = host_machine.system() -if host_os == 'android' - host_os_family = 'linux' -else - host_os_family = host_os -endif +host_os_family = host_machine.system() +host_os = host_machine.subsystem() if host_machine.cpu_family() == 'arm' host_arch = 'arm' host_abi = 'arm' @@ -84,30 +80,6 @@ if host_arch == 'arm' endif if host_os_family == 'darwin' - apple_os_flavors = [ - ['macOS', 'OSX'], - ['iOS', 'IOS'], - ['watchOS', 'WATCH'], - ['tvOS', 'TV'], - ] - foreach candidate : apple_os_flavors - name = candidate[0] - constant = candidate[1] - if cc.compiles(''' - #include - #if !TARGET_OS_@0@ - # error Nope - #endif - '''.format(constant), - name: f'compiling for @name@') - host_os = name.to_lower() - break - endif - endforeach - if host_os == 'darwin' - error('Unable to detect Apple OS flavor') - endif - have_ptrauth_src = ''' #ifdef __clang__ # if __has_feature (ptrauth_calls) @@ -128,10 +100,6 @@ else have_ptrauth = false endif -if host_os_family == 'linux' and cc.has_header('android/api-level.h') - host_os = 'android' -endif - if host_os_family == 'windows' host_executable_format = 'pe' elif host_os_family == 'darwin'