- PSPDEV
- TinyGo
- Wasm3
- You need compile it with PSP toolchain
- or You can use my forked version wasm3-for-psp
Basically, you can use the aforementioned forked version, but just in case it becomes outdated, I’m including this information as a precaution.
git clone [email protected]:wasm3/wasm3.git
cd wasm3
- Append the following code to
CMakeLists.txt
install(DIRECTORY "${PROJECT_SOURCE_DIR}/source/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING PATTERN "*.h")
install(TARGETS m3
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- Create
psp-toolchain.cmake
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR mips)
set(PSPDEV $ENV{PSPDEV})
set(CMAKE_C_COMPILER ${PSPDEV}/bin/psp-gcc)
set(CMAKE_CXX_COMPILER ${PSPDEV}/bin/psp-g++)
set(CMAKE_AR ${PSPDEV}/bin/psp-ar)
set(CMAKE_RANLIB ${PSPDEV}/bin/psp-ranlib)
set(CMAKE_FIND_ROOT_PATH ${PSPDEV})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../psp-toolchain.cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_WASI=none -DCMAKE_INSTALL_PREFIX=~/wasm3
make
make install
mkdir build
cd build
psp-cmake ..
make
tinygo build -o hello.wasm -target=wasm -no-debug main.go