Always search for both 32+64 bit Discord GameSDK lib

This commit is contained in:
Inori 2019-12-14 17:12:53 -05:00 committed by Inori
parent c0ecb6bab9
commit 21da5b74c0
2 changed files with 27 additions and 15 deletions

View file

@ -8,23 +8,30 @@ minimum_macos_version = get_option('macos_min_version')
xxd = find_program('xxd', native: true)
objfw = find_program('objfw-config', native: true)
host_system = host_machine.system()
compilers = {'cpp': meson.get_compiler('cpp'), 'objc': meson.get_compiler('objc'), 'objcpp': meson.get_compiler('objcpp')}
global_sources = []
global_dependencies = []
global_include_dirs = []
global_args = []
global_link_args = []
# ====================
# Ext libs
# ====================
ext_dependencies = []
# DISCORD
discord = false
discord_libpath = get_option('discord_sdk_path')
if discord_libpath != ''
discordlib = compilers['cpp'].find_library('discord_game_sdk', required: false, dirs: '@0@/lib/@1@'.format(discord_libpath, host_machine.cpu_family()))
discordlib = compilers['cpp'].find_library('discord_game_sdk', required: false, dirs: [discord_libpath+'/lib/x86', discord_libpath+'/lib/x86_64'])
if discordlib.found() == true
add_project_arguments(['-I@0@/c'.format(discord_libpath), '-DHAVE_DISCORDSDK'], language: 'cpp')
ext_dependencies += discordlib
global_include_dirs += include_directories(discord_libpath+'/c')
global_args += ['-I@0@/c'.format(discord_libpath), '-DHAVE_DISCORDSDK']
global_dependencies += discordlib
discord = true
endif
endif
@ -32,14 +39,12 @@ endif
# ====================
# Main source
# ====================
global_sources = []
global_dependencies = []
global_include_dirs = []
global_args = []
global_link_args = []
# Suppress warnings
global_args += ['-Wno-non-virtual-dtor', '-Wno-reorder']
global_args += ['-Wno-non-virtual-dtor', '-Wno-reorder', '-Wno-uninitialized', '-Wno-unknown-pragmas']
if compilers['objc'].get_id() == 'clang'
global_args += ['-Wno-undefined-var-template','-Wno-delete-non-abstract-non-virtual-dtor']
endif
if get_option('workdir_current')
global_args += '-DWORKDIR_CURRENT'
@ -65,10 +70,17 @@ global_args += run_command(objfw,'--cppflags').stdout().split()
add_project_arguments(run_command(objfw,'--objcflags').stdout().split(), language:'objc')
add_project_link_arguments(run_command(objfw,'--libs','--ldflags').stdout().split(), language:['objc','objcpp'])
if (compilers['objc'].get_id() == 'clang' and get_option('gc_type') == 'arc' and host_machine.cpu_family() == 'x86_64')
gc = get_option('gc_type')
if gc == 'auto'
gc = compilers['objc'].first_supported_argument('-fobjc-gc', '-fobjc-gc-only', '-fobjc-arc')
if gc != []
add_project_arguments(gc, language: ['objc','objcpp'])
endif
elif gc == 'arc'
add_project_arguments(run_command(objfw,'--arc').stdout().split(), language: ['objc','objcpp'])
else
add_project_arguments('-fobjc-gc', language: ['objc', 'objcpp'])
add_project_arguments('-fobjc-'+get_option('gc_type'), language: ['objc', 'objcpp'])
endif
subdir('src')
@ -91,7 +103,7 @@ elif host_system == 'darwin'
if compilers['cpp'].get_id() == 'clang'
add_project_arguments('-stdlib=libc++', language: ['cpp','objcpp'])
add_project_arguments('-std=c++11', language: 'objcpp')
global_args += ['-Wno-undefined-var-template', '-mmacosx-version-min='+minimum_macos_version]
global_args += '-mmacosx-version-min='+minimum_macos_version
global_link_args += '-mmacosx-version-min='+minimum_macos_version
endif
else
@ -100,7 +112,7 @@ endif
executable(meson.project_name(),
sources: global_sources,
dependencies: [global_dependencies, ext_dependencies],
dependencies: global_dependencies,
include_directories: global_include_dirs,
link_args: global_link_args,
cpp_args: global_args,

View file

@ -3,7 +3,7 @@ option('mk', type: 'boolean', value: false, description: 'Build to fit Marin\'s
option('ruby_lib', type: 'string', value: 'ruby', description: 'Name of the Ruby library')
option('console', type: 'boolean', value: true, description: 'Whether to debug information in the console')
option('macos_min_version', type: 'string', value: '10.10', description: 'Minimum macOS system version to support')
option('gc_type', type: 'combo', choices: ['gc','arc'], value: 'arc', description: 'Which method of garbage collection to utilize')
option('gc_type', type: 'combo', choices: ['gc','gc-only','arc', 'auto', 'none'], value: 'auto', description: 'Which method of garbage collection to utilize')
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')