From b2cc96cf0d39ecf8bad69241a7daff83d5a66308 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 8 Feb 2023 01:37:35 +0100 Subject: [PATCH] scripts: wscript: nswitch: do the libstdc++ hack right before build to not pollute the environment --- engine/wscript | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/wscript b/engine/wscript index d4b32f73..d650a457 100644 --- a/engine/wscript +++ b/engine/wscript @@ -58,12 +58,8 @@ def configure(conf): if not conf.env.HAVE_SDL2: conf.fatal('SDL2 not availiable! Install switch-sdl2!') conf.define('XASH_SDL', 2) - # HACK: now link in the entirety of libstdc++ so that dynamic libs could use all of it without manual exporting - # we can't do this right away because std::filesystem will complain about not having pathconf(), - # which we have defined in sys_nswitch.c conf.env.LDFLAGS.remove('-lstdc++') conf.env.LDFLAGS.remove('-lm') - conf.env.LDFLAGS += ['-Wl,--whole-archive', '-lstdc++', '-Wl,--no-whole-archive', '-lm'] elif conf.options.FBDEV_SW: # unused, XASH_LINUX without XASH_SDL gives fbdev & alsa support # conf.define('XASH_FBDEV', 1) @@ -195,6 +191,10 @@ def build(bld): # Switch has custom parameters if bld.env.DEST_OS == 'nswitch': + # HACK: link in the entirety of libstdc++ so that dynamic libs could use all of it without manual exporting + # we can't do this right away because std::filesystem will complain about not having pathconf(), + # which we have defined in sys_nswitch.c + bld.env.LDFLAGS += ['-Wl,--whole-archive', '-lstdc++', '-Wl,--no-whole-archive', '-lm'] bld(source = source, target = 'xash', features = 'c cxxprogram',