Skip to content

Commit

Permalink
meson: fix executable extensions for windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Oct 11, 2024
1 parent 30655dd commit bd1961b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/nix/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,23 @@ nix_symlinks = [
'nix-store',
]

name_suffix = ''
if host_machine.system() == 'windows'
name_suffix = '.exe'
endif

foreach linkname : nix_symlinks
install_symlink(
linkname,
linkname + name_suffix,
# TODO(Qyriad): should these continue to be relative symlinks?
pointing_to : 'nix',
pointing_to : fs.name(this_exe),
install_dir : get_option('bindir'),
# The 'runtime' tag is what executables default to, which we want to emulate here.
install_tag : 'runtime'
)
t = custom_target(
command: ['ln', '-sf', fs.name(this_exe), '@OUTPUT@'],
output: linkname,
output: linkname + name_suffix,
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
build_by_default: true
)
Expand All @@ -233,15 +238,15 @@ endforeach

install_symlink(
'build-remote',
pointing_to : '..' / '..'/ get_option('bindir') / 'nix',
install_dir : get_option('libexecdir') / 'nix',
pointing_to : '..' / '..'/ get_option('bindir') / fs.name(this_exe),
install_dir : get_option('libexecdir') / fs.name(this_exe),
# The 'runtime' tag is what executables default to, which we want to emulate here.
install_tag : 'runtime'
)

custom_target(
command: ['ln', '-sf', fs.name(this_exe), '@OUTPUT@'],
output: 'build-remote',
output: 'build-remote' + name_suffix,
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
build_by_default: true
)
Expand Down

0 comments on commit bd1961b

Please sign in to comment.