mirror of https://github.com/odrling/Aegisub
meson: set correct flags when compiling LuaJIT on Windows
This commit is contained in:
parent
1fc019447a
commit
130339a3d6
|
@ -11,25 +11,33 @@ endif
|
|||
dynasm_dasc = files('../vm_@0@.dasc'.format(dynasm_arch))
|
||||
dasm = [minilua, files('../../dynasm/dynasm.lua')]
|
||||
|
||||
# BUG: meson does not resolve paths correctly for subprojects
|
||||
hpre = '#include "@0@/../lj_arch.h"'.format(meson.current_source_dir())
|
||||
|
||||
checkdefs = [
|
||||
['LJ_ARCH_BITS', '64', ['-D', 'P64']],
|
||||
['LJ_HASJIT', '1', ['-D', 'JIT']],
|
||||
['LJ_HASFFI', '1', ['-D', 'FFI']],
|
||||
['LJ_DUALNUM', '1', ['-D', 'DUALNUM']],
|
||||
]
|
||||
|
||||
if host_machine.cpu_family() == 'x86'
|
||||
checkdefs += ['__SSE2__', '1', ['-D', 'SSE']]
|
||||
endif
|
||||
|
||||
foreach def: checkdefs
|
||||
if cc.get_define(def[0], prefix: hpre) == def[1]
|
||||
dasm += def[2]
|
||||
if cc.get_id() == 'msvc'
|
||||
# the cl.exe preprocessor seemingly removes/expands macros, so hardcode flags
|
||||
dasm += ['-D', 'WIN', '-D', 'JIT', '-D', 'FFI']
|
||||
if host_machine.cpu_family() == 'x86_64'
|
||||
dasm += ['-D', 'P64']
|
||||
endif
|
||||
endforeach
|
||||
else
|
||||
# BUG: meson does not resolve paths correctly for subprojects
|
||||
hpre = '#include "@0@/../lj_arch.h"'.format(meson.current_source_dir())
|
||||
|
||||
checkdefs = [
|
||||
['LJ_ARCH_BITS', '64', ['-D', 'P64']],
|
||||
['LJ_HASJIT', '1', ['-D', 'JIT']],
|
||||
['LJ_HASFFI', '1', ['-D', 'FFI']],
|
||||
['LJ_DUALNUM', '1', ['-D', 'DUALNUM']],
|
||||
]
|
||||
|
||||
if host_machine.cpu_family() == 'x86'
|
||||
checkdefs += ['__SSE2__', '1', ['-D', 'SSE']]
|
||||
endif
|
||||
|
||||
foreach def: checkdefs
|
||||
if cc.get_define(def[0], prefix: hpre) == def[1]
|
||||
dasm += def[2]
|
||||
endif
|
||||
endforeach
|
||||
endif
|
||||
|
||||
buildvm_src = files(
|
||||
'buildvm.c',
|
||||
|
|
Loading…
Reference in New Issue