This commit is contained in:
2025-11-22 22:25:59 -06:00
parent 20685d80f1
commit 44c46f2bb4
9 changed files with 29 additions and 4407 deletions

View File

@@ -67,32 +67,6 @@ endif
cmake = import('cmake')
# Try to find system-installed mbedtls first
mbedtls_dep = dependency('mbedtls', static: true, required: false)
mbedx509_dep = dependency('mbedx509', static: true, required: false)
mbedcrypto_dep = dependency('mbedcrypto', static: true, required: false)
if not mbedtls_dep.found() or not mbedx509_dep.found() or not mbedcrypto_dep.found()
message('⚙ System mbedtls not found, building subproject...')
mbedtls_opts = cmake.subproject_options()
mbedtls_opts.add_cmake_defines({
'ENABLE_PROGRAMS': 'OFF', # Disable Mbed TLS programs
'ENABLE_TESTING': 'OFF', # Disable Mbed TLS tests
'CMAKE_BUILD_TYPE': 'Release', # Optimize for release
'MBEDTLS_FATAL_WARNINGS': 'ON', # Treat warnings as errors
'USE_STATIC_MBEDTLS_LIBRARY': 'ON',# Build static libraries
'USE_SHARED_MBEDTLS_LIBRARY': 'OFF'# Disable shared libraries
})
mbedtls_proj = cmake.subproject('mbedtls', options: mbedtls_opts)
deps += [
mbedtls_proj.dependency('mbedtls'),
mbedtls_proj.dependency('mbedx509'),
mbedtls_proj.dependency('mbedcrypto')
]
else
deps += [mbedtls_dep, mbedx509_dep, mbedcrypto_dep]
endif
sdl3_opts = cmake.subproject_options()
sdl3_opts.add_cmake_defines({
'SDL_STATIC': 'ON',
@@ -222,6 +196,15 @@ else
deps += chipmunk_dep
endif
# Try to find system-installed curl first
curl_dep = dependency('libcurl', static: true, required: false)
if not curl_dep.found()
message('⚙ System curl not found, building subproject...')
deps += dependency('libcurl', static:true)
else
deps += curl_dep
endif
if host_machine.system() != 'emscripten'
# Try to find system-installed enet first
enet_dep = dependency('enet', static: true, required: false)
@@ -288,48 +271,13 @@ else
message('⚙ QR code support disabled')
endif
# Always build for Steam unless it's Emscripten
if host_machine.system() == 'emscripten'
storefront = 'none'
else
storefront = 'steam'
endif
if storefront == 'steam'
steam_sdk_path = meson.current_source_dir() / 'sdk'
if host_machine.system() == 'darwin'
steam_lib_path = steam_sdk_path / 'redistributable_bin' / 'osx' / 'libsteam_api.dylib'
elif host_machine.system() == 'linux'
steam_lib_path = steam_sdk_path / 'redistributable_bin' / 'linux64' / 'libsteam_api.so'
elif host_machine.system() == 'windows'
steam_lib_path = steam_sdk_path / 'redistributable_bin' / 'win64' / 'steam_api64.lib'
else
steam_lib_path = ''
endif
if fs.exists(steam_lib_path)
steam_dep = declare_dependency(
include_directories: include_directories('sdk/public'),
link_args: [steam_lib_path]
)
deps += steam_dep
src += 'qjs_steam.cpp'
message('Steam SDK enabled')
else
error('Steam SDK required but not found at: ' + steam_lib_path)
endif
else
add_project_arguments('-DNSTEAM', language: ['c', 'cpp'])
message('Storefront: ' + storefront)
endif
link_args = link
sources = []
src += [
'anim.c', 'config.c', 'datastream.c','font.c','HandmadeMath.c','jsffi.c','model.c',
'render.c','simplex.c','spline.c', 'transform.c','cell.c', 'wildmatch.c',
'sprite.c', 'rtree.c', 'qjs_nota.c', 'qjs_soloud.c', 'qjs_sdl.c', 'qjs_sdl_input.c', 'qjs_sdl_video.c', 'qjs_sdl_surface.c', 'qjs_sdl_gpu.c', 'qjs_math.c', 'qjs_geometry.c', 'qjs_transform.c', 'qjs_sprite.c', 'qjs_io.c', 'qjs_fd.c', 'qjs_os.c', 'qjs_actor.c',
'qjs_wota.c', 'monocypher.c', 'qjs_blob.c', 'qjs_crypto.c', 'qjs_time.c', 'qjs_http.c', 'qjs_rtree.c', 'qjs_spline.c', 'qjs_js.c', 'qjs_debug.c', 'picohttpparser.c', 'qjs_miniz.c', 'timer.c', 'qjs_socket.c', 'qjs_kim.c', 'qjs_utf8.c', 'qjs_fit.c', 'qjs_text.c', 'qjs_staef.c', 'qjs_layout.c', 'cell_qoi.c'
'qjs_wota.c', 'monocypher.c', 'qjs_blob.c', 'qjs_crypto.c', 'qjs_time.c', 'qjs_http.c', 'qjs_rtree.c', 'qjs_spline.c', 'qjs_js.c', 'qjs_debug.c', 'qjs_miniz.c', 'timer.c', 'qjs_socket.c', 'qjs_kim.c', 'qjs_utf8.c', 'qjs_fit.c', 'qjs_text.c', 'qjs_staef.c', 'qjs_layout.c', 'cell_qoi.c'
]
# quirc src
src += [