Fix Compile (#188)
* Fix freecam rotation smoothing * Configure freecam controller * Fix cont z button and impl freecam on/off events * Add torch static comp * Fixed cmake * Copied yamls * Fixed cmake * Added github workflows * Update CMakeLists.txt --------- Co-authored-by: KiritoDv <kiritodev01@gmail.com>
This commit is contained in:
parent
008d527ed5
commit
bb90ff8531
|
|
@ -1,31 +1,51 @@
|
|||
name: Linux Compile test
|
||||
name: Linux Validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "*" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "*" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: 0
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.1
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "true"
|
||||
- name: Get Complementary file
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
path: complementary_file
|
||||
repository: UnspaghettifyKart/action-build-private-file
|
||||
ssh-key: ${{ secrets.LINUX_SSH_PRIVATE_KEY }}
|
||||
submodules: recursive
|
||||
- name: Update machine
|
||||
run: sudo apt update
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev libvorbis-dev
|
||||
- name: Install latest SDL
|
||||
run: |
|
||||
sudo apt install build-essential cmake pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev libcapstone-dev
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
wget https://www.libsdl.org/release/SDL2-2.24.1.tar.gz
|
||||
tar -xzf SDL2-2.24.1.tar.gz
|
||||
cd SDL2-2.24.1
|
||||
./configure
|
||||
make -j 10
|
||||
sudo make install
|
||||
- name: Install latest tinyxml2
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
|
||||
tar -xzf 10.0.0.tar.gz
|
||||
cd tinyxml2-10.0.0
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
- name: Build
|
||||
run: |
|
||||
cp -r complementary_file/* .
|
||||
echo "${{ secrets.AES_KEY }}" | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in baserom.us.z64.aes -out baserom.us.z64
|
||||
make assets
|
||||
make -j || ./first-diff.py
|
||||
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-cmake -j
|
||||
- name: Create Package
|
||||
run: |
|
||||
mkdir spaghetti-release
|
||||
mv build-cmake/spaghetti spaghetti-release/
|
||||
- name: Publish packaged artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: spaghetti-linux-x64
|
||||
path: spaghetti-release
|
||||
retention-days: 1
|
||||
|
|
|
|||
|
|
@ -1,32 +1,29 @@
|
|||
name: Macos Compile test
|
||||
name: MacOS Validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "*" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "*" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: 0
|
||||
runs-on: macos-latest
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.1
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "true"
|
||||
- name: Get Complementary file
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
path: complementary_file
|
||||
repository: UnspaghettifyKart/action-build-private-file
|
||||
ssh-key: ${{ secrets.MACOS_SSH_PRIVATE_KEY }}
|
||||
submodules: recursive
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew update
|
||||
brew install python3 capstone coreutils make pkg-config tehzz/n64-dev/mips64-elf-binutils cmake
|
||||
run: brew install sdl2 libpng glew ninja cmake libzip nlohmann-json tinyxml2 spdlog vorbis-tools
|
||||
- name: Build
|
||||
run: |
|
||||
cp -r complementary_file/* .
|
||||
echo "${{ secrets.AES_KEY }}" | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in baserom.us.z64.aes -out baserom.us.z64
|
||||
make assets
|
||||
make -j
|
||||
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-cmake -j
|
||||
- name: Create Package
|
||||
run: |
|
||||
mkdir spaghetti-release
|
||||
mv build-cmake/spaghetti spaghetti-release/
|
||||
- name: Publish packaged artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: spaghetti-mac-x64
|
||||
path: spaghetti-release
|
||||
retention-days: 1
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
name: GenerateBuilds
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
generate-port-o2r:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install gcc g++ git cmake ninja-build lsb-release
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2.13
|
||||
with:
|
||||
key: ${{ runner.os }}-o2r-ccache-${{ github.ref }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-o2r-ccache-${{ github.ref }}
|
||||
${{ runner.os }}-o2r-ccache-
|
||||
- name: Cache build folders
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-o2r-build-${{ github.ref }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-o2r-build-${{ github.ref }}
|
||||
${{ runner.os }}-o2r-build-
|
||||
path: |
|
||||
torch/cmake-build-release
|
||||
- name: Generate spaghetti.o2r
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
make -C torch type=release -j3
|
||||
torch/cmake-build-release/torch pack port spaghetti.o2r o2r
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: spaghetti.o2r
|
||||
path: spaghetti.o2r
|
||||
retention-days: 1
|
||||
|
||||
build-windows:
|
||||
needs: generate-port-o2r
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build ./build/x64 --config Release --parallel 10
|
||||
- name: Download spaghetti.o2r
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: spaghetti.o2r
|
||||
path: ./build/x64/Release
|
||||
- name: Create Package
|
||||
run: |
|
||||
mkdir spaghetti-release
|
||||
mv build/x64/Release/Spaghetti.exe spaghetti-release/
|
||||
mv build/x64/Release/spaghetti.o2r spaghetti-release/
|
||||
mv config.yml spaghetti-release/
|
||||
mv assets spaghetti-release/
|
||||
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt" -OutFile "spaghetti-release/gamecontrollerdb.txt"
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: spaghetti-windows
|
||||
path: spaghetti-release
|
||||
|
||||
build-macos:
|
||||
needs: generate-port-o2r
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install dependencies
|
||||
run: brew install sdl2 libpng glew ninja cmake libzip nlohmann-json tinyxml2 spdlog vorbis-tools
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-cmake --config Release -j3
|
||||
- name: Download spaghetti.o2r
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: spaghetti.o2r
|
||||
path: ./build-cmake
|
||||
- name: Create Package
|
||||
run: |
|
||||
mkdir spaghetti-release
|
||||
mv build-cmake/Spaghetti spaghetti-release/
|
||||
mv build-cmake/spaghetti.o2r spaghetti-release/
|
||||
mv config.yml spaghetti-release/
|
||||
mv assets spaghetti-release/
|
||||
wget -O spaghetti-release/gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt
|
||||
- name: Publish packaged artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: spaghetti-mac-x64
|
||||
path: spaghetti-release
|
||||
|
||||
build-linux:
|
||||
needs: generate-port-o2r
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Update machine
|
||||
run: sudo apt update
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev libvorbis-dev
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2.14
|
||||
with:
|
||||
key: linux-ccache-${{ github.ref }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
linux-ccache-${{ github.ref }}
|
||||
linux-ccache-
|
||||
- name: Cache build folders
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: linux-build-${{ github.ref }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
linux-build-${{ github.ref }}
|
||||
linux-build-
|
||||
path: |
|
||||
SDL2-2.30.3
|
||||
tinyxml2-10.0.0
|
||||
libzip-1.10.1
|
||||
- name: Install latest SDL
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
if [ ! -d "SDL2-2.30.3" ]; then
|
||||
wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz
|
||||
tar -xzf SDL2-2.30.3.tar.gz
|
||||
fi
|
||||
cd SDL2-2.30.3
|
||||
./configure --enable-hidapi-libusb
|
||||
make -j 10
|
||||
sudo make install
|
||||
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
||||
- name: Install latest tinyxml2
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
|
||||
tar -xzf 10.0.0.tar.gz
|
||||
cd tinyxml2-10.0.0
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
- name: Install libzip without crypto
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
if [ ! -d "libzip-1.10.1" ]; then
|
||||
wget https://github.com/nih-at/libzip/releases/download/v1.10.1/libzip-1.10.1.tar.gz
|
||||
tar -xzf libzip-1.10.1.tar.gz
|
||||
fi
|
||||
cd libzip-1.10.1
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF
|
||||
make
|
||||
sudo make install
|
||||
sudo cp -av /usr/local/lib/libzip* /lib/x86_64-linux-gnu/
|
||||
- name: Download spaghetti.o2r
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: spaghetti.o2r
|
||||
path: ./build-cmake
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build-cmake --config Release -j3
|
||||
(cd build-cmake && cpack -G External)
|
||||
wget -O gamecontrollerdb.txt https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt
|
||||
mv README.md readme.txt
|
||||
mv build-cmake/*.appimage spaghetti.appimage
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Spaghetti-linux
|
||||
path: |
|
||||
spaghetti.appimage
|
||||
config.yml
|
||||
assets
|
||||
gamecontrollerdb.txt
|
||||
|
|
@ -1,32 +1,23 @@
|
|||
name: Windows Compile test
|
||||
name: Windows Validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "*" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
branches: [ "*" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: 0
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.1
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: "true"
|
||||
- name: Get Complementary file
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
path: complementary_file
|
||||
repository: UnspaghettifyKart/action-build-private-file
|
||||
ssh-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
Invoke-WebRequest https://github.com/coco875/mk64-tools/releases/download/v0.0.8/mips-tools-chain-windows.zip -OutFile mips-tools-chain-windows.zip
|
||||
Expand-Archive mips-tools-chain-windows.zip -DestinationPath mips-tools-chain-windows
|
||||
Copy-Item -Path mips-tools-chain-windows/mingw64 -Destination tools -Recurse
|
||||
submodules: recursive
|
||||
- name: Build
|
||||
run: |
|
||||
Copy-Item -Path complementary_file/* -Destination . -Recurse
|
||||
echo "${{ secrets.AES_KEY }}" | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in baserom.us.z64.aes -out baserom.us.z64
|
||||
python tools/windows_build.py
|
||||
cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build ./build/x64
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: spaghetti-windows
|
||||
path: ./build/x64/Debug
|
||||
retention-days: 1
|
||||
|
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
|
|||
|
||||
# Set the project version and language
|
||||
project(Spaghettify VERSION 0.1.0 LANGUAGES C CXX ASM)
|
||||
include(FetchContent)
|
||||
|
||||
if(APPLE)
|
||||
enable_language(OBJCXX)
|
||||
|
|
@ -23,11 +24,11 @@ include(FindFontconfig)
|
|||
include(cmake/lus-cvars.cmake)
|
||||
|
||||
if (WIN32)
|
||||
include(cmake/automate-vcpkg.cmake)
|
||||
include(libultraship/cmake/automate-vcpkg.cmake)
|
||||
set(VCPKG_TRIPLET x64-windows-static)
|
||||
set(VCPKG_TARGET_TRIPLET x64-windows-static)
|
||||
vcpkg_bootstrap()
|
||||
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 glew glfw3 nlohmann-json tinyxml2 spdlog libogg libvorbis)
|
||||
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3 nlohmann-json tinyxml2 spdlog libogg libvorbis)
|
||||
|
||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
|
||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
|
|
@ -375,8 +376,8 @@ if(USE_NETWORKING)
|
|||
endif()
|
||||
find_package(SDL2_net REQUIRED)
|
||||
include_directories(${SDL2_NET_INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_net::SDL2_net)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_NETWORKING)
|
||||
# target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_net::SDL2_net)
|
||||
# target_compile_definitions(${PROJECT_NAME} PRIVATE USE_NETWORKING)
|
||||
endif()
|
||||
|
||||
option(USE_STANDALONE "Build as a standalone executable" OFF)
|
||||
|
|
@ -636,38 +637,3 @@ add_custom_target(
|
|||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/spaghetti.o2r" "${CMAKE_BINARY_DIR}/spaghetti.o2r"
|
||||
)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
add_custom_target(CreateOSXIcons
|
||||
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset
|
||||
COMMAND sips -z 16 16 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_16x16.png
|
||||
COMMAND sips -z 32 32 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_16x16@2x.png
|
||||
COMMAND sips -z 32 32 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_32x32.png
|
||||
COMMAND sips -z 64 64 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_32x32@2x.png
|
||||
COMMAND sips -z 128 128 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_128x128.png
|
||||
COMMAND sips -z 256 256 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_128x128@2x.png
|
||||
COMMAND sips -z 256 256 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_256x256.png
|
||||
COMMAND sips -z 512 512 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_256x256@2x.png
|
||||
COMMAND sips -z 512 512 logo.png --out ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_512x512.png
|
||||
COMMAND cp logo.png ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset/icon_512x512@2x.png
|
||||
COMMAND iconutil -c icns -o ${CMAKE_BINARY_DIR}/macosx/spaghettikart.icns ${CMAKE_BINARY_DIR}/macosx/spaghettikart.iconset
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Creating OSX icons ..."
|
||||
)
|
||||
add_dependencies(${PROJECT_NAME} CreateOSXIcons)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/Info.plist" "${CMAKE_BINARY_DIR}/Info.plist" COPYONLY)
|
||||
endif()
|
||||
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY APPIMAGE_DESKTOP_FILE_TERMINAL YES)
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY APPIMAGE_DESKTOP_FILE "${CMAKE_SOURCE_DIR}/SpaghettiKart.desktop")
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY APPIMAGE_ICON_FILE "${CMAKE_SOURCE_DIR}/logo.png")
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(CPACK_GENERATOR "External")
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows|NintendoSwitch|CafeOS")
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
set(CPACK_GENERATOR "Bundle")
|
||||
endif()
|
||||
|
||||
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/cmake/configure-packaging.cmake)
|
||||
include(cmake/packaging.cmake)
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue