PSP2: Update for Unity

This commit is contained in:
Jeffrey Pfau 2015-08-15 02:26:47 -07:00
parent abcc83f68c
commit d263cca5fc
2 changed files with 14 additions and 1 deletions

View File

@ -10,6 +10,10 @@ else()
set(DEVKITARM ${DEVKITPRO}/devkitARM)
endif()
if(NOT DEFINED UNITY)
set(UNITY ON)
endif()
set(toolchain_dir ${DEVKITARM}/psp2)
set(toolchain_bin_dir ${toolchain_dir}/bin)
set(cross_prefix ${DEVKITARM}/bin/arm-none-eabi-)
@ -24,7 +28,11 @@ set(CMAKE_AR ${cross_prefix}ar CACHE INTERNAL "archiver")
set(CMAKE_C_COMPILER ${cross_prefix}gcc CACHE INTERNAL "c compiler")
set(CMAKE_CXX_COMPILER ${cross_prefix}g++ CACHE INTERNAL "cxx compiler")
set(CMAKE_ASM_COMPILER ${cross_prefix}gcc CACHE INTERNAL "assembler")
set(common_flags "${arch_flags} -fno-reorder-functions -fno-optimize-sibling-calls ${inc_flags}")
if(NOT UNITY)
set(common_flags "${arch_flags} -fno-reorder-functions -fno-optimize-sibling-calls ${inc_flags}")
else()
set(common_flags "${arch_flags} -fno-gcse -fno-tree-vectorize ${inc_flags}")
endif()
set(CMAKE_C_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_ASM_FLAGS ${common_flags} CACHE INTERNAL "c compiler flags")
set(CMAKE_CXX_FLAGS ${common_flags} CACHE INTERNAL "cxx compiler flags")

View File

@ -257,3 +257,8 @@ void GBAPSP2Draw(void) {
vita2d_draw_texture_scale(tex, 120, 32, 3.0f, 3.0f);
}
}
__attribute__((noreturn, weak)) void __assert_func(const char* file, int line, const char* func, const char* expr) {
printf("ASSERT FAILED: %s in %s at %s:%i\n", expr, func, file, line);
exit(1);
}