#!/usr/bin/env python from misc.utility.scons_hints import * Import("env") vita_files = [ "godot_vita.cpp", "os_vita.cpp", "display_server_vita.cpp", "gl_manager_vita.cpp", "rasterizer_gxm_vita.cpp", "audio_driver_vita.cpp", "joypad_vita.cpp", "vita_posix_compat.c", # POSIX funcs newlib declares but doesn't implement. "vita_cpp_compat.cpp", # ...and the ones VitaSDK declares without extern "C". ] if env["vita_gxm3d"]: vita_files[vita_files.index("godot_vita.cpp")] = "godot_vita_gxm3d.cpp" vita_files[vita_files.index("rasterizer_gxm_vita.cpp")] = "rasterizer_gxm3d_vita.cpp" if env["vita_shared"]: # Engine archives are SCons nodes; external SDK libraries are strings. # Leave external imports unresolved for default_dynlib in the loader. # Resolve engine archives as a group, pulling only reachable members. # Whole-archive also pulls unused third-party tools (e.g. HarfBuzz subset # and PDF painting) with hidden dependencies absent from this runtime. shared_env = env.Clone() shared_env["LIBS"] = [lib for lib in env.Flatten(env["LIBS"]) if not isinstance(lib, str)] shared_env["LINKFLAGS"] = [ "-shared", "-nostdlib", "-fPIC", "-Wl,--unresolved-symbols=ignore-all", "-Wl,-soname,libgodot.so", "-Wl,--hash-style=sysv", ] shared_env["LINKCOM"] = "$CXX -o $TARGET $LINKFLAGS $SOURCES -Wl,--start-group $_LIBDIRFLAGS $_LIBFLAGS -Wl,--end-group" shared_env["PROGSUFFIX"] = ".so" runtime = shared_env.add_program("#bin/libgodot_gxm3d" if env["vita_gxm3d"] else "#bin/libgodot", vita_files) Default(runtime) Return() prog = env.add_program("#bin/godot", vita_files) # --- Vita packaging pipeline (VELF -> FSELF -> eboot.bin -> VPK) -------------- # Mirrors the 3.x port. Requires vita-elf-create / vita-make-fself / vita-mksfoex # / vita-pack-vpk from VitaSDK (paths come from env["VITASDK_BIN"]). bindir = env["VITASDK_BIN"] env.Append( BUILDERS={ "VitaStrip": Builder(action=[Copy("$TARGET", "$SOURCE"), bindir + "arm-vita-eabi-strip -g $TARGET"]), "VitaELF": Builder(action=bindir + "vita-elf-create $SOURCE $TARGET"), "VitaSelf": Builder(action=bindir + "vita-make-fself -s -c $SOURCE $TARGET"), } ) stripped = env.VitaStrip("#bin/godot.stripped.elf", prog) velf = env.VitaELF("#bin/godot.velf", stripped) eboot = env.VitaSelf("#bin/eboot.bin", velf) # NOTE: param.sfo generation and vita-pack-vpk are left to a helper script / # the export plugin so the icon, LiveArea assets and title-id can be supplied # per-project. See platform/vita/app/ for the template LiveArea layout. Default(eboot)