Browse Source

scripts: wscript: nswitch: do the libstdc++ hack right before build to not pollute the environment

pull/2/head
fgsfds 2 years ago
parent
commit
b2cc96cf0d
  1. 8
      engine/wscript

8
engine/wscript

@ -58,12 +58,8 @@ def configure(conf): @@ -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): @@ -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',

Loading…
Cancel
Save