Fix loader tests not compiling for Linux.

This commit is contained in:
tschumann 2025-02-22 12:26:45 +10:00 committed by Nicholas Hastings
parent 7e24188759
commit 598ef73a8e

View File

@ -5,9 +5,18 @@ for cxx in MMS.all_targets:
name = 'test_loader'
binary = MMS.Program(cxx, name)
# NOTE: this macro isn't getting fed through for some reason
if binary.compiler.target.platform == 'windows' and binary.compiler.target.arch == 'x86_64':
binary.compiler.defines += ['WIN64']
# add some required defines for Linux builds
if binary.compiler.target.platform == 'linux' and binary.compiler.target.arch == 'x86':
binary.compiler.defines += ['LIB_PREFIX=""', 'LIB_SUFFIX="_i486.so"']
# add some required defines for Linux builds
if binary.compiler.target.platform == 'linux' and binary.compiler.target.arch == 'x86_64':
binary.compiler.defines += ['LIB_PREFIX="lib"', 'LIB_SUFFIX=".so"']
# TODO: hack - something makes it try and compile with /SUBSYSTEM:WINDOWS which then causes it to complain that WinMain is missing
if binary.compiler.target.platform == 'windows':
binary.compiler.linkflags = ['Advapi32.lib', 'kernel32.lib', 'shell32.lib']
@ -26,7 +35,7 @@ for cxx in MMS.all_targets:
binary.sources += [
'main.cpp',
'../gamedll.cpp',
'../loader.cpp',
'../loader.cpp',
'../serverplugin.cpp',
'../utility.cpp',
'testdeterminebackends1.cpp',