Skip to content

aethiopicuschan/wasm3-tinygo-psp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wasm3 + TinyGo on PSP

License: MIT

psp

Required

How to build

Wasm3

Basically, you can use the aforementioned forked version, but just in case it becomes outdated, I’m including this information as a precaution.

  1. git clone [email protected]:wasm3/wasm3.git
  2. cd wasm3
  3. 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})
  1. 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)
  1. mkdir build && cd build
  2. cmake .. -DCMAKE_TOOLCHAIN_FILE=../psp-toolchain.cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_WASI=none -DCMAKE_INSTALL_PREFIX=~/wasm3
  3. make
  4. make install

Runtime(main.c)

mkdir build
cd build
psp-cmake ..
make

Go

tinygo build -o hello.wasm -target=wasm -no-debug main.go

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published