Add Switch game framework target

This commit is contained in:
2026-06-09 00:52:04 +08:00
parent cc75b94c44
commit b78aaa5cad
10 changed files with 218 additions and 12 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ function add_frostbite2d_target()
local libnx = path.join(devkitpro, "libnx")
add_cxflags("-D__SWITCH__", "-march=armv8-a+crc+crypto", "-mtune=cortex-a57", "-mtp=soft", {public = true})
add_cxflags("-ffunction-sections", "-fdata-sections", {public = true})
add_cxflags("-ffunction-sections", "-fdata-sections", "-fPIE", {public = true})
add_cxflags("-specs=" .. path.join(libnx, "switch.specs"), {public = true, force = true})
add_ldflags("-specs=" .. path.join(libnx, "switch.specs"), {public = true, force = true})
@@ -47,7 +47,7 @@ function add_frostbite2d_target()
add_includedirs(path.join(libnx, "include"), {public = true})
add_linkdirs(path.join(portlibs, "lib"), path.join(libnx, "lib"), {public = true})
add_links("SDL2_ttf", "freetype", "SDL2_mixer", "vorbisidec", "opusfile", "opus", "modplug", "mpg123", "mikmod", "FLAC", "ogg", {public = true})
add_links("SDL2_image", "png", "jpeg", "webp", "z", "SDL2", "EGL", "GLESv2", "glapi", "drm_nouveau", "nx", "m", "pthread", {public = true})
add_links("SDL2_image", "png", "jpeg", "webp", "z", "SDL2", "EGL", "GLESv2", "glapi", "drm_nouveau", "nx", "m", "pthread", "stdc++", {public = true})
else
add_packages("libsdl2", {public = true})
add_packages("libsdl2_image", {public = true})