summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-11-08 02:34:04 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-11-08 02:34:04 +0100
commit8ea8da50d1f01fbbfce9e752d73a9303334555b4 (patch)
tree7b57544c376ca8907ccf26a878c2d12e202b50e4 /CMakeLists.txt
parent468468633e2b07e39d3edeb169a1924d4c4ce773 (diff)
Upload TIM files into VRAM
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
1 files changed, 20 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c98b7c..aedfac7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,20 +6,36 @@ endif()
set(CMAKE_C_COMPILER psx-gcc)
set(CMAKE_CXX_COMPILER psx-g++)
+set(CMAKE_AR mipsel-unknown-elf-ar)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_CROSSCOMPILING 1)
project(pinboid C)
-add_executable(${PROJECT_NAME}
- "src/main.c"
+add_executable(${PROJECT_NAME} "src/main.c")
+
+set(modules
+ "res"
+ "src/game"
+ "src/gfx"
+ "src/system"
)
+
+set(mode pal) # pal or ntsc
+
+foreach(c ${modules})
+ add_subdirectory(${c})
+endforeach()
+
+target_link_libraries(${PROJECT_NAME} PUBLIC init game)
+
target_link_directories(${PROJECT_NAME} PUBLIC $ENV{PSXSDK_PATH}/lib)
target_compile_options(${PROJECT_NAME} PUBLIC -DFIXMATH_FAST_SIN -D_PAL_MODE_
- -DPSXSDK_DEBUG -DNO_CDDA -DNO_INTRO -Wall -g3 -Og)
+ -DPSXSDK_DEBUG -DNO_CDDA -DNO_INTRO -Wall -g3 -Og -ffunction-sections
+ -fdata-sections)
target_link_libraries(${PROJECT_NAME} PUBLIC -lpsx -lfixmath)
target_include_directories(${PROJECT_NAME} PRIVATE . $ENV{PSXSDK_PATH}/include)
-set(cdroot cdimg)
+set(cdroot ${CMAKE_SOURCE_DIR}/cdimg)
add_custom_target(exe ALL elf2exe ${PROJECT_NAME}
${cdroot}/${PROJECT_NAME}.exe -mark="A homebrew game created with PSXSDK"
DEPENDS ${PROJECT_NAME})