diff options
| author | John "Lameguy" Wilbert Villamor <lameguy64@gmail.com> | 2021-10-15 09:22:45 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-15 09:22:45 +0800 |
| commit | dd0f088aaa4c6bf013643be2d1d8621dbffdb000 (patch) | |
| tree | d848d6ce007d8bb9357c8b99d6a0a39ec41d244e /examples/graphics/render2tex | |
| parent | 9e08d1047fa8deeb3ccb3ce9bb11d69e25a52d56 (diff) | |
| parent | eb719a424e6a16fb64209139a32c9f8a7235a929 (diff) | |
| download | psn00bsdk-dd0f088aaa4c6bf013643be2d1d8621dbffdb000.tar.gz | |
Merge pull request #38 from spicyjpeg/cmake
Full CMake support (in place of makefiles)
Diffstat (limited to 'examples/graphics/render2tex')
| -rw-r--r-- | examples/graphics/render2tex/CMakeLists.txt | 28 | ||||
| -rw-r--r-- | examples/graphics/render2tex/makefile | 65 | ||||
| -rw-r--r-- | examples/graphics/render2tex/texture.s.template (renamed from examples/graphics/render2tex/texture.s) | 3 |
3 files changed, 29 insertions, 67 deletions
diff --git a/examples/graphics/render2tex/CMakeLists.txt b/examples/graphics/render2tex/CMakeLists.txt new file mode 100644 index 0000000..42a063b --- /dev/null +++ b/examples/graphics/render2tex/CMakeLists.txt @@ -0,0 +1,28 @@ +# PSn00bSDK example CMake script +# (C) 2021 spicyjpeg - MPL licensed + +cmake_minimum_required(VERSION 3.21) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) + set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) +endif() + +project( + render2tex + LANGUAGES C ASM + VERSION 1.0.0 + DESCRIPTION "PSn00bSDK render-to-texture example" + HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" +) + +configure_file(texture.s.template texture.s) + +file(GLOB _sources *.c) +psn00bsdk_add_executable( + render2tex STATIC + ${_sources} + ${PROJECT_BINARY_DIR}/texture.s +) +#psn00bsdk_add_cd_image(render2tex_iso render2tex iso.xml DEPENDS render2tex) + +install(FILES ${PROJECT_BINARY_DIR}/render2tex.exe DESTINATION .) diff --git a/examples/graphics/render2tex/makefile b/examples/graphics/render2tex/makefile deleted file mode 100644 index bb0ef3c..0000000 --- a/examples/graphics/render2tex/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# PSn00bSDK makefile template -# Part of the PSn00bSDK Project -# 2019 - 2021 Lameguy64 / Meido-Tek Productions - -## Settings - -PSN00BSDK_LIBS ?= ../../../libpsn00b - -# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's -# root folder (it only depends on environment variables). -include ../../../psn00bsdk-setup.mk - -# Project target name -TARGET = render2tex - -## Files - -# Searches for C, C++ and S (assembler) files in local directory -CFILES = $(notdir $(wildcard *.c)) -CPPFILES= $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) - -# Create names for object files -OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ - $(addprefix build/,$(CPPFILES:.cpp=.o)) \ - $(addprefix build/,$(AFILES:.s=.o)) - -# Project specific includes and libraries -# (use -I for include dirs, -L for library dirs, -l for static libraries) -INCLUDE += -LIBDIRS += -LIBS += - -## Build rules - -#all: iso -all: build/$(TARGET) - -iso: build/$(TARGET) resources - $(MKPSXISO) -y -q iso.xml - -resources: - # Add commands to build/convert your assets here - #$(LZPACK) data.xml - -build/$(TARGET): $(OFILES) - @mkdir -p $(dir $@) - $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ - $(NM) -f posix -l -n $@ >$@.map - $(ELF2X) -q $@ $@.exe - -build/%.o: %.c - @mkdir -p $(dir $@) - $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.s - @mkdir -p $(dir $@) - $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -clean: - rm -rf build diff --git a/examples/graphics/render2tex/texture.s b/examples/graphics/render2tex/texture.s.template index e786dce..8b09ad8 100644 --- a/examples/graphics/render2tex/texture.s +++ b/examples/graphics/render2tex/texture.s.template @@ -5,5 +5,4 @@ .global tim_blendpattern .type tim_blendpattern, @object tim_blendpattern: - .incbin "blendpattern-16c.tim" -
\ No newline at end of file + .incbin "${PROJECT_SOURCE_DIR}/blendpattern-16c.tim" |
