mirror of
https://github.com/NixOS/nix
synced 2025-07-03 06:11:46 +02:00
Merge pull request #11809 from nix-windows/windows-build/meson-fixes
Meson fixes for msys2 builds
This commit is contained in:
commit
dfd0033afb
5 changed files with 47 additions and 14 deletions
30
meson.build
30
meson.build
|
@ -22,10 +22,12 @@ subproject('libcmd')
|
||||||
subproject('nix')
|
subproject('nix')
|
||||||
|
|
||||||
# Docs
|
# Docs
|
||||||
subproject('internal-api-docs')
|
if get_option('doc-gen')
|
||||||
subproject('external-api-docs')
|
subproject('internal-api-docs')
|
||||||
if not meson.is_cross_build()
|
subproject('external-api-docs')
|
||||||
subproject('nix-manual')
|
if not meson.is_cross_build()
|
||||||
|
subproject('nix-manual')
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# External C wrapper libraries
|
# External C wrapper libraries
|
||||||
|
@ -35,17 +37,19 @@ subproject('libexpr-c')
|
||||||
subproject('libmain-c')
|
subproject('libmain-c')
|
||||||
|
|
||||||
# Language Bindings
|
# Language Bindings
|
||||||
if not meson.is_cross_build()
|
if get_option('bindings') and not meson.is_cross_build()
|
||||||
subproject('perl')
|
subproject('perl')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
subproject('libutil-test-support')
|
if get_option('unit-tests')
|
||||||
subproject('libutil-tests')
|
subproject('libutil-test-support')
|
||||||
subproject('libstore-test-support')
|
subproject('libutil-tests')
|
||||||
subproject('libstore-tests')
|
subproject('libstore-test-support')
|
||||||
subproject('libfetchers-tests')
|
subproject('libstore-tests')
|
||||||
subproject('libexpr-test-support')
|
subproject('libfetchers-tests')
|
||||||
subproject('libexpr-tests')
|
subproject('libexpr-test-support')
|
||||||
subproject('libflake-tests')
|
subproject('libexpr-tests')
|
||||||
|
subproject('libflake-tests')
|
||||||
|
endif
|
||||||
subproject('nix-functional-tests')
|
subproject('nix-functional-tests')
|
||||||
|
|
13
meson.options
Normal file
13
meson.options
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# vim: filetype=meson
|
||||||
|
|
||||||
|
option('doc-gen', type : 'boolean', value : true,
|
||||||
|
description : 'Generate documentation',
|
||||||
|
)
|
||||||
|
|
||||||
|
option('unit-tests', type : 'boolean', value : true,
|
||||||
|
description : 'Build unit tests',
|
||||||
|
)
|
||||||
|
|
||||||
|
option('bindings', type : 'boolean', value : true,
|
||||||
|
description : 'Build language bindings (e.g. Perl)',
|
||||||
|
)
|
|
@ -34,6 +34,8 @@ subdir('build-utils-meson/subprojects')
|
||||||
run_command('ln', '-s',
|
run_command('ln', '-s',
|
||||||
meson.project_build_root() / '__nothing_link_target',
|
meson.project_build_root() / '__nothing_link_target',
|
||||||
meson.project_build_root() / '__nothing_symlink',
|
meson.project_build_root() / '__nothing_symlink',
|
||||||
|
# native doesn't allow dangling symlinks, which the tests require
|
||||||
|
env : { 'MSYS' : 'winsymlinks:lnk' },
|
||||||
check : true,
|
check : true,
|
||||||
)
|
)
|
||||||
can_link_symlink = run_command('ln',
|
can_link_symlink = run_command('ln',
|
||||||
|
@ -74,6 +76,11 @@ if host_machine.system() == 'darwin'
|
||||||
deps_other += [sandbox]
|
deps_other += [sandbox]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if host_machine.system() == 'windows'
|
||||||
|
wsock32 = cxx.find_library('wsock32')
|
||||||
|
deps_other += [wsock32]
|
||||||
|
endif
|
||||||
|
|
||||||
subdir('build-utils-meson/threads')
|
subdir('build-utils-meson/threads')
|
||||||
|
|
||||||
boost = dependency(
|
boost = dependency(
|
||||||
|
|
|
@ -230,6 +230,8 @@ foreach linkname : nix_symlinks
|
||||||
t = custom_target(
|
t = custom_target(
|
||||||
command: ['ln', '-sf', fs.name(this_exe), '@OUTPUT@'],
|
command: ['ln', '-sf', fs.name(this_exe), '@OUTPUT@'],
|
||||||
output: linkname + executable_suffix,
|
output: linkname + executable_suffix,
|
||||||
|
# native doesn't allow dangling symlinks, but the target executable often doesn't exist at this time
|
||||||
|
env : { 'MSYS' : 'winsymlinks:lnk' },
|
||||||
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
|
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
|
||||||
build_by_default: true
|
build_by_default: true
|
||||||
)
|
)
|
||||||
|
@ -248,6 +250,8 @@ install_symlink(
|
||||||
custom_target(
|
custom_target(
|
||||||
command: ['ln', '-sf', fs.name(this_exe), '@OUTPUT@'],
|
command: ['ln', '-sf', fs.name(this_exe), '@OUTPUT@'],
|
||||||
output: 'build-remote' + executable_suffix,
|
output: 'build-remote' + executable_suffix,
|
||||||
|
# native doesn't allow dangling symlinks, but the target executable often doesn't exist at this time
|
||||||
|
env : { 'MSYS' : 'winsymlinks:lnk' },
|
||||||
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
|
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
|
||||||
build_by_default: true
|
build_by_default: true
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,7 +17,12 @@ fs = import('fs')
|
||||||
nix = find_program('nix')
|
nix = find_program('nix')
|
||||||
bash = find_program('bash', native : true)
|
bash = find_program('bash', native : true)
|
||||||
busybox = find_program('busybox', native : true, required : false)
|
busybox = find_program('busybox', native : true, required : false)
|
||||||
coreutils = find_program('coreutils', native : true)
|
if host_machine.system() == 'windows'
|
||||||
|
# Because of the state of symlinks on Windows, coreutils.exe doesn't usually exist, but things like ls.exe will
|
||||||
|
coreutils = find_program('ls', native : true)
|
||||||
|
else
|
||||||
|
coreutils = find_program('coreutils', native : true)
|
||||||
|
endif
|
||||||
dot = find_program('dot', native : true, required : false)
|
dot = find_program('dot', native : true, required : false)
|
||||||
|
|
||||||
nix_bin_dir = fs.parent(nix.full_path())
|
nix_bin_dir = fs.parent(nix.full_path())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue