cmake: fix ps2 support

This commit is contained in:
Anonymous Maarten 2021-07-09 19:32:45 +02:00
parent c1400ecfab
commit fe07db1b21
2 changed files with 13 additions and 6 deletions

View File

@ -16,7 +16,7 @@ elseif(NINTENDO_SWITCH)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/nx")
include(NXFunctions)
elseif(PS2)
set(LIBRW_PLATFORMS "NULL" "PS2")
set(LIBRW_PLATFORMS "PS2")
set(LIBRW_PLATFORM_GL3_REQUIRES_OPENGL OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/ps2")
include(PS2Functions)
@ -24,7 +24,8 @@ else()
set(LIBRW_PLATFORMS "NULL" "GL3")
set(LIBRW_PLATFORM_GL3_REQUIRES_OPENGL ON)
endif()
set(LIBRW_PLATFORM "NULL" CACHE STRING "Platform")
list(GET LIBRW_PLATFORMS 0 LIBRW_PLATFORM_DEFAULT)
set(LIBRW_PLATFORM "${LIBRW_PLATFORM_DEFAULT}" CACHE STRING "Platform")
set_property(CACHE LIBRW_PLATFORM PROPERTY STRINGS ${LIBRW_PLATFORMS})
message(STATUS "LIBRW_PLATFORM = ${LIBRW_PLATFORM} (choices=${LIBRW_PLATFORMS})")
set("LIBRW_PLATFORM_${LIBRW_PLATFORM}" ON)
@ -55,7 +56,7 @@ include(CMakeDependentOption)
option(LIBRW_TOOLS "Build librw tools" ON)
option(LIBRW_INSTALL "Install librw files" OFF)
cmake_dependent_option(LIBRW_EXAMPLES "Build librw examples" ON "NOT LIBRW_PLATFORM_PS2;NOT LIBRW_PLATFORM_NULL" OFF)
cmake_dependent_option(LIBRW_EXAMPLES "Build librw examples" ON "LIBRW_TOOLS;NOT LIBRW_PLATFORM_NULL" OFF)
if(LIBRW_INSTALL)
include(GNUInstallDirs)
@ -127,12 +128,14 @@ if(LIBRW_INSTALL)
if(NOT LIBRW_PLATFORM_PS2)
if(WIN32)
set(os "-win")
elseif(NINTENDO_SWITCH)
set(os "-switch")
elseif(PS2)
set(os "-ps2")
elseif(APPLE)
set(os "-apple")
elseif(UNIX)
set(os "-linux")
elseif(NINTENDO_SWITCH)
set(os "-switch")
else()
set(compiler "-UNK")
message(WARNING "Unknown os. Created cpack package will be wrong. (override using cpack -P)")

View File

@ -3,8 +3,12 @@ add_executable(ps2test
main.cpp
mem.h
ps2.h
vu/defaultpipe.dsm
vu/skinpipe.dsm
vu/light.vu
vu/setup_persp.vu
)
target_link_libraries(ps2test
@ -13,7 +17,7 @@ target_link_libraries(ps2test
kernel
)
librw_platform_target(ps2test)
librw_platform_target(ps2test INSTALL)
if(LIBRW_INSTALL)
install(TARGETS ps2test