Skip to content

Commit

Permalink
fix: build-utils-meson to set SYSTEM
Browse files Browse the repository at this point in the history
  • Loading branch information
tomberek committed Aug 9, 2024
1 parent cfe66db commit 20321ce
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions build-utils-meson/set-system/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
host_cpu = host_machine.cpu_family()
if host_cpu in ['x86', 'i686', 'i386']
# Meson considers 32-bit x86 CPUs to be "x86", and does not consider 64-bit
# x86 CPUs to be "x86" (instead using "x86_64", which needs no translation).
host_cpu = 'i686'
elif host_cpu == 'amd64'
# This should not be needed under normal circumstances, but someone could pass a --cross-file
# that sets the cpu_family to this.
host_cpu = 'x86_64'
elif host_cpu in ['armv6', 'armv7']
host_cpu += 'l'
endif

host_system = host_machine.cpu_family() + '-' + host_machine.system()
message('canonical Nix system name:', host_system)

is_linux = host_machine.system() == 'linux'
is_darwin = host_machine.system() == 'darwin'
is_freebsd = host_machine.system() == 'freebsd'
is_x64 = host_machine.cpu_family() == 'x86_64'
3 changes: 2 additions & 1 deletion src/libstore/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ configdata = configuration_data()
# TODO rename, because it will conflict with downstream projects
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())

configdata.set_quoted('SYSTEM', host_machine.system())
subdir('build-utils-meson/set-system')
configdata.set_quoted('SYSTEM', host_system)

deps_private_maybe_subproject = [
]
Expand Down

0 comments on commit 20321ce

Please sign in to comment.