1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

fix cross-build for cygwin

This commit is contained in:
David McFarland 2025-09-22 09:09:45 -03:00
parent 28c0089268
commit 32d4ea8140
2 changed files with 13 additions and 0 deletions

View file

@ -5,6 +5,15 @@ if not (host_machine.system() == 'windows' and cxx.get_id() == 'gcc')
deps_private += dependency('threads') deps_private += dependency('threads')
endif endif
if host_machine.system() == 'cygwin'
# -std=gnu on cygwin defines 'unix', which conflicts with the namespace
add_project_arguments(
'-D_POSIX_C_SOURCE=200809L',
'-D_GNU_SOURCE',
language : 'cpp',
)
endif
add_project_arguments( add_project_arguments(
'-Wdeprecated-copy', '-Wdeprecated-copy',
'-Werror=suggest-override', '-Werror=suggest-override',

View file

@ -69,6 +69,10 @@ if bdw_gc.found()
define_value = cxx.has_function(funcspec).to_int() define_value = cxx.has_function(funcspec).to_int()
configdata_priv.set(define_name, define_value) configdata_priv.set(define_name, define_value)
endforeach endforeach
if host_machine.system() == 'cygwin'
# undefined reference to `__wrap__Znwm'
configdata_pub.set('GC_NO_INLINE_STD_NEW', 1)
endif
endif endif
# Used in public header. Affects ABI! # Used in public header. Affects ABI!
configdata_pub.set('NIX_USE_BOEHMGC', bdw_gc.found().to_int()) configdata_pub.set('NIX_USE_BOEHMGC', bdw_gc.found().to_int())