build: simplify platform detection

This commit is contained in:
Michael Vetter
2026-02-05 13:03:26 +01:00
parent 32ca4a2e30
commit e29c418452

View File

@@ -10,21 +10,14 @@ project('profanity', 'c',
# Determine platform # Determine platform
host_system = host_machine.system() host_system = host_machine.system()
platform = 'unknown' platform_map = {
'freebsd': 'freebsd',
if host_system == 'freebsd' 'netbsd': 'netbsd',
platform = 'freebsd' 'openbsd': 'openbsd',
elif host_system == 'netbsd' 'darwin': 'osx',
platform = 'netbsd' 'cygwin': 'cygwin',
elif host_system == 'openbsd' }
platform = 'openbsd' platform = platform_map.get(host_system, 'nix')
elif host_system == 'darwin'
platform = 'osx'
elif host_system == 'cygwin'
platform = 'cygwin'
else
platform = 'nix'
endif
# Configuration data # Configuration data
conf_data = configuration_data() conf_data = configuration_data()