Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,9 @@ jobs:
apk update
apk add build-base make git cmake

- name: Compile masp
- name: Compile OpenVCL and examples
run: |
git clone https://github.com/fjtrujy/masp.git
cd masp
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PS2DEV"
cmake --build build -j $(getconf _NPROCESSORS_ONLN)
cmake --install build

- name: Compile OpenVCL
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PS2DEV"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PS2DEV" -DBUILD_EXAMPLES=ON
cmake --build build -j $(getconf _NPROCESSORS_ONLN)

- name: Run OpenVCL tests
Expand All @@ -39,10 +31,6 @@ jobs:
run: |
cmake --install build

- name: Build PS2 examples
run: |
make -C examples all

- name: Get short SHA
id: slug
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ openvcl
t2-output

*.o
*.vo
*.elf
*.vsm
!test/fixtures/
Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,15 @@ include(CTest)
if(BUILD_TESTING)
add_subdirectory(test)
endif()

# PS2 examples – require PS2SDK environment variable and the PS2 toolchain.
# Enabled automatically when $PS2SDK is set; override with -DBUILD_EXAMPLES=ON/OFF.
if(DEFINED ENV{PS2SDK})
option(BUILD_EXAMPLES "Build PS2 examples (requires PS2SDK toolchain)" ON)
else()
option(BUILD_EXAMPLES "Build PS2 examples (requires PS2SDK toolchain)" OFF)
endif()

if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
23 changes: 23 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
set(_EXAMPLES pdk sprite triangle triangle-gasp triangle_strip)

foreach(_example IN LISTS _EXAMPLES)
string(REPLACE "-" "_" _target_name "${_example}")
add_custom_target(example_${_target_name}
COMMAND ${CMAKE_MAKE_PROGRAM}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_example}
COMMENT "Building example: ${_example}"
VERBATIM
)
add_dependencies(example_${_target_name} openvcl)
list(APPEND _EXAMPLE_TARGETS example_${_target_name})
endforeach()

# sprite, triangle, triangle-gasp, and triangle_strip all link against libpdk.a
foreach(_dep sprite triangle triangle_gasp triangle_strip)
add_dependencies(example_${_dep} example_pdk)
endforeach()

add_custom_target(examples ALL
DEPENDS ${_EXAMPLE_TARGETS}
COMMENT "Building all PS2 examples"
)
15 changes: 15 additions & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SUBDIRS = pdk sprite triangle triangle-gasp triangle_strip

all:
$(MAKE) -C pdk
$(MAKE) -C sprite
$(MAKE) -C triangle
$(MAKE) -C triangle-gasp
$(MAKE) -C triangle_strip

clean:
$(MAKE) -C pdk clean
$(MAKE) -C sprite clean
$(MAKE) -C triangle clean
$(MAKE) -C triangle-gasp clean
$(MAKE) -C triangle_strip clean
Binary file removed fast_nolights.vo
Binary file not shown.
12 changes: 12 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,20 @@ target_compile_definitions(openvcl_unit_tests PRIVATE
# themselves don't need -Isrc because their own #include "Foo.h" directives
# resolve via the source file's own directory. Test files reach openvcl
# headers via explicit relative paths like #include "../src/Expression.h".
# OpenVclVersion.h is generated by configure_file; reproduce it here so both
# standalone (cmake -S test) and integrated (add_subdirectory) builds work.
# CMAKE_PROJECT_VERSION is the top-level project version when built from root,
# and empty when built standalone (acceptable for test purposes).
set(PROJECT_VERSION "${CMAKE_PROJECT_VERSION}")
configure_file(
"${OPENVCL_ROOT}/src/OpenVclVersion.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/OpenVclVersion.h"
@ONLY
)

target_include_directories(openvcl_unit_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}
)

# The library code was written for an older C++ dialect; silence the warnings
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/integration/test_cli.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "test_harness.h"
#include "openvcl_runner.h"

#include "../../src/OpenVclVersion.h"
#include "OpenVclVersion.h"

#include <string>
#include <vector>
Expand Down
25 changes: 0 additions & 25 deletions tundra.lua

This file was deleted.

Loading