Don't build MiniFFI on 64-bit Windows

MiniFFI/Win32API is now optional, and requires
sizeof(void*) == sizeof(long)
This commit is contained in:
Inori 2019-12-31 13:42:44 -05:00 committed by Inori
parent 7ff906c507
commit 796ceabe9c
5 changed files with 530 additions and 573 deletions

File diff suppressed because it is too large Load diff

View file

@ -29,12 +29,15 @@ binding_source = [files(
'module_rpg.cpp', 'module_rpg.cpp',
'filesystem-binding.cpp', 'filesystem-binding.cpp',
'windowvx-binding.cpp', 'windowvx-binding.cpp',
'tilemapvx-binding.cpp', 'tilemapvx-binding.cpp'
'miniffi-binding.cpp'
)] )]
if discord == true if discord == true
binding_source += files('discord-binding.cpp') binding_source += files('discord-binding.cpp')
endif endif
if miniffi == true
binding_source += files('miniffi-binding.cpp')
endif
global_sources += binding_source global_sources += binding_source

View file

@ -53,6 +53,20 @@ if compilers['objc'].get_id() == 'clang'
global_args += ['-Wno-undefined-var-template', '-Wno-delete-non-abstract-non-virtual-dtor'] global_args += ['-Wno-undefined-var-template', '-Wno-delete-non-abstract-non-virtual-dtor']
endif endif
# Decide whether or not to use MiniFFI
miniffi = get_option('use_miniffi')
if miniffi == true
if compilers['cpp'].sizeof('void*') == compilers['cpp'].sizeof('long')
miniffi = true
global_args += '-DUSE_MINIFFI'
else
warning('64-bit MiniFFI is only supported on Linux and macOS.')
warning('To use MiniFFI/Win32API on Windows, target 32-bit.')
miniffi = false
endif
endif
# Defines
if get_option('workdir_current') if get_option('workdir_current')
global_args += '-DWORKDIR_CURRENT' global_args += '-DWORKDIR_CURRENT'
endif endif
@ -61,7 +75,7 @@ if get_option('independent_appimage')
global_args += '-DINDEPENDENT_APPIMAGE' global_args += '-DINDEPENDENT_APPIMAGE'
endif endif
if get_option('use_fakeapi') if get_option('use_fakeapi') == true and miniffi == true
global_args += '-DUSE_FAKEAPI' global_args += '-DUSE_FAKEAPI'
endif endif
@ -73,6 +87,7 @@ if get_option('mk')
global_args += '-DMARIN' global_args += '-DMARIN'
endif endif
# Objectify our C # Objectify our C
global_args += run_command(objfw,'--cppflags').stdout().split() global_args += run_command(objfw,'--cppflags').stdout().split()
add_project_arguments(run_command(objfw,'--objcflags').stdout().split(), language:['objc','objcpp']) add_project_arguments(run_command(objfw,'--objcflags').stdout().split(), language:['objc','objcpp'])

View file

@ -6,7 +6,8 @@ option('macos_min_version', type: 'string', value: '10.10', description: 'Minimu
option('shared_fluid', type: 'boolean', value: false, description: 'Dynamically link fluidsynth at build time') option('shared_fluid', type: 'boolean', value: false, description: 'Dynamically link fluidsynth at build time')
option('cjk_fallback_font', type: 'boolean', value: false, description: 'Use WenQuanYi Micro Hei as the fallback font') option('cjk_fallback_font', type: 'boolean', value: false, description: 'Use WenQuanYi Micro Hei as the fallback font')
option('use_fakeapi', type: 'boolean', value: false, description: 'Attempt to repair Win32API calls that do not work with MKXP') option('use_miniffi', type: 'boolean', value: true, description: 'Enable MiniFFI Ruby module (Win32API)')
option('use_fakeapi', type: 'boolean', value: false, description: 'Attempt to repair Win32API calls that do not work with MKXP. Requires MiniFFI')
option('default_framerate', type: 'boolean', value: false, description: 'Disable syncToRefreshrate and fixedFramerate configuration options') option('default_framerate', type: 'boolean', value: false, description: 'Disable syncToRefreshrate and fixedFramerate configuration options')
option('no_preload_scripts', type: 'boolean', value: false, description: 'Disable the preloadScript configuration option') option('no_preload_scripts', type: 'boolean', value: false, description: 'Disable the preloadScript configuration option')
option('workdir_current', type: 'boolean', value: false, description: 'Keep current directory on startup') option('workdir_current', type: 'boolean', value: false, description: 'Keep current directory on startup')

View file

@ -83,7 +83,7 @@ main_source = files(
'lang-fun.mm' 'lang-fun.mm'
) )
if get_option('use_fakeapi') == true if get_option('use_fakeapi') == true and miniffi == true
main_source += files('fake-api.mm') main_source += files('fake-api.mm')
endif endif