From f62a28716301a1176aa5d6b6c6a13f11d0f4f99f Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Sat, 1 Feb 2025 21:36:50 +1100 Subject: [PATCH] Only enable big-obj on Windows --- nix-meson-build-support/big-objs/meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nix-meson-build-support/big-objs/meson.build b/nix-meson-build-support/big-objs/meson.build index f5abd8bd8..7e422abd8 100644 --- a/nix-meson-build-support/big-objs/meson.build +++ b/nix-meson-build-support/big-objs/meson.build @@ -1,4 +1,6 @@ -# libexpr's primops creates a large object -# Without the following flag, we'll get errors when cross-compiling to mingw32: -# Fatal error: can't write 66 bytes to section .text of src/libexpr/libnixexpr.dll.p/primops.cc.obj: 'file too big' -add_project_arguments([ '-Wa,-mbig-obj' ], language: 'cpp') +if host_machine.system() == 'windows' + # libexpr's primops creates a large object + # Without the following flag, we'll get errors when cross-compiling to mingw32: + # Fatal error: can't write 66 bytes to section .text of src/libexpr/libnixexpr.dll.p/primops.cc.obj: 'file too big' + add_project_arguments([ '-Wa,-mbig-obj' ], language: 'cpp') +endif