-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
29 lines (24 loc) · 1.05 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
cmake_minimum_required(VERSION 3.10)
project(kubridge VERSION 1.0 LANGUAGES ASM)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
#Stolen from Davee's Infinity Source
function(build_stubs _OBJS STUB_NAME STUB_COUNT)
foreach(X RANGE ${STUB_COUNT})
string(LENGTH "0000${X}" X_POSTFIX_LENGTH)
math(EXPR X_POSTFIX_LENGTH "${X_POSTFIX_LENGTH}-4")
string(SUBSTRING "0000${X}" ${X_POSTFIX_LENGTH} 4 X_POSTFIX)
add_library("${STUB_NAME}_${X_POSTFIX}" OBJECT "${STUB_NAME}.S")
target_compile_definitions("${STUB_NAME}_${X_POSTFIX}" PRIVATE "F_${STUB_NAME}_${X_POSTFIX}")
set(OBJS ${OBJS} "$<TARGET_OBJECTS:${STUB_NAME}_${X_POSTFIX}>")
endforeach()
set(${_OBJS} ${OBJS} PARENT_SCOPE)
endfunction()
build_stubs(kubridge_OBJS kubridge 17)
add_library(pspkubridge STATIC
${kubridge_OBJS}
)
install( TARGETS pspkubridge CONFIGURATIONS RELEASE
DESTINATION $ENV{PSPDEV}/psp/lib)
install( FILES ${CMAKE_SOURCE_DIR}/include/kubridge.h DESTINATION $ENV{PSPDEV}/psp/include)