start playdate support

This commit is contained in:
2025-12-06 17:35:23 -06:00
parent 687c6d264f
commit 3f2b4177d6
6 changed files with 601 additions and 12 deletions

View File

@@ -8,7 +8,7 @@ libtype = get_option('default_library')
link = []
src = []
add_project_arguments('-Wno-gnu-label-as-value', '-Wno-int-conversion', language: ['c'])
add_project_arguments('-Wno-int-conversion', language: ['c'])
git_tag_cmd = run_command('git', 'describe', '--tags', '--abbrev=0', check: false)
cell_version = 'unknown'
@@ -33,8 +33,7 @@ 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-command-line-argument', language: 'c')
add_project_arguments('-Wno-unused-command-line-argument', language: 'cpp')
add_project_arguments('-Wno-unused-function', language: 'c')
deps = []
@@ -49,6 +48,10 @@ if host_machine.system() == 'darwin'
endforeach
endif
if host_machine.system() == 'playdate'
add_project_arguments('-DTARGET_PLAYDATE', language: 'c')
endif
cmake = import('cmake')
cc = meson.get_compiler('c')
@@ -66,7 +69,7 @@ if host_machine.system() == 'windows'
endif
if host_machine.system() != 'emscripten'
if host_machine.system() != 'emscripten' and host_machine.system() != 'playdate'
# Try to find system-installed enet first
enet_dep = dependency('enet', static: true, required: false)
if not enet_dep.found()
@@ -118,7 +121,9 @@ src += [ # core
'miniz.c'
]
if get_option('single_threaded')
if host_machine.system() == 'playdate'
src += ['scheduler_single.c']
elif get_option('single_threaded')
src += ['scheduler_single.c']
else
src += ['scheduler_threaded.c']
@@ -141,7 +146,6 @@ scripts = [
'debug.c',
'os.c',
'fd.c',
'socket.c',
'http.c',
'enet.c',
'wildstar.c',
@@ -153,6 +157,12 @@ 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]