playdate support

This commit is contained in:
2025-12-07 04:04:11 -06:00
parent ce5949e0ee
commit c24a5079cb
21 changed files with 1645 additions and 4614 deletions

View File

@@ -8,32 +8,15 @@ libtype = get_option('default_library')
link = []
src = []
add_project_arguments('-Wno-int-conversion', language: ['c'])
git_tag_cmd = run_command('git', 'describe', '--tags', '--abbrev=0', check: false)
cell_version = 'unknown'
if git_tag_cmd.returncode() == 0
cell_version = git_tag_cmd.stdout().strip()
endif
git_commit_cmd = run_command('git', 'rev-parse', '--short', 'HEAD', check: false)
cell_commit = 'unknown'
if git_commit_cmd.returncode() == 0
cell_commit = git_commit_cmd.stdout().strip()
endif
# Important: pass the definitions without double-escaping quotes
add_project_arguments(
'-DCELL_VERSION="' + cell_version + '"',
'-DCELL_COMMIT="' + cell_commit + '"',
language : 'c'
'-Wno-incompatible-pointer-types',
'-Wno-missing-braces',
'-Wno-strict-prototypes',
'-Wno-unused-function',
'-Wno-int-conversion',
language: 'c'
)
add_project_arguments('-Wno-incompatible-pointer-types', language: 'c')
add_project_arguments('-Wno-narrowing', language: 'cpp')
add_project_arguments('-Wno-missing-braces', language:'c')
add_project_arguments('-Wno-strict-prototypes', language:'c')
add_project_arguments('-Wno-unused-function', language: 'c')
deps = []
@@ -52,24 +35,6 @@ if host_machine.system() == 'playdate'
add_project_arguments('-DTARGET_PLAYDATE', language: 'c')
endif
cmake = import('cmake')
cc = meson.get_compiler('c')
if host_machine.system() == 'linux'
deps += cc.find_library('asound', required:true)
deps += [dependency('x11'), dependency('xi'), dependency('xcursor'), dependency('egl'), dependency('gl')]
endif
if host_machine.system() == 'windows'
deps += cc.find_library('bcrypt')
deps += cc.find_library('winhttp')
link += ['-static', '-static-libgcc', '-static-libstdc++']
add_project_link_arguments('-static-libgcc', '-static-libstdc++', language: ['c', 'cpp'])
endif
#link += '-rdynamic'
link_args = link
sources = []
src += [ # core
@@ -79,18 +44,12 @@ src += [ # core
'wildmatch.c',
'qjs_actor.c',
'qjs_wota.c',
'miniz.c'
'miniz.c',
'quickjs.c',
'libregexp.c', 'libunicode.c', 'cutils.c', 'dtoa.c'
]
if host_machine.system() == 'playdate'
src += ['scheduler_single.c']
elif get_option('single_threaded')
src += ['scheduler_single.c']
else
src += ['scheduler_threaded.c']
endif
src += ['quickjs.c', 'libregexp.c', 'libunicode.c', 'cutils.c', 'dtoa.c']
src += ['scheduler.c']
scripts = [
'nota.c',
@@ -118,12 +77,6 @@ foreach file: scripts
sources += files(full_path)
endforeach
if host_machine.system() == 'playdate'
sources += files('source/fd_playdate.c')
else
sources += files('scripts/fd.c')
endif
srceng = 'source'
includes = [srceng]
@@ -201,18 +154,3 @@ cell = custom_target('cell',
install_headers('source/cell.h')
install_headers('source/quickjs.h')
install_headers('source/wota.h')
tests = [
'spawn_actor',
'empty',
'nota',
'wota',
'portalspawner',
'overling',
'send',
'delay'
]
foreach file : tests
test(file, cell, args:['tests/' + file])
endforeach