Skip to content

Commit 798d862

Browse files
committed
use different compile options for release/debug
1 parent 540a044 commit 798d862

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,12 @@ endif()
306306

307307
if(VITA)
308308
#set(VITA_FLAGS "-Ofast -mcpu=cortex-a9 -mfpu=neon -fgraphite-identity -floop-parallelize-all -floop-nest-optimize -ftree-parallelize-loops=3 -flto -fno-peephole2 -DNDEBUG")
309-
set(VITA_FLAGS "-O2 -g -mcpu=cortex-a9 -mfpu=neon -fno-peephole2 -DNDEBUG")
309+
if(CMAKE_BUILD_TYPE STREQUAL "Release")
310+
set(VITA_FLAGS "-Ofast -mcpu=cortex-a9 -mfpu=neon -fgraphite-identity -floop-parallelize-all -floop-nest-optimize -ftree-parallelize-loops=3 -fno-peephole2 -DNDEBUG -ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
311+
else()
312+
set(VITA_FLAGS "-O2 -g -mcpu=cortex-a9 -mfpu=neon -fno-peephole2 -DNDEBUG")
313+
add_definitions(-D_DEBUG)
314+
endif()
310315
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VITA_FLAGS}")
311316
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VITA_FLAGS}")
312317

@@ -322,7 +327,6 @@ if(VITA)
322327

323328
include("${CMAKE_SOURCE_DIR}/vita/vita.cmake")
324329
add_definitions(-D__unix)
325-
add_definitions(-D_DEBUG)
326330
target_compile_definitions(${EXECUTABLE_NAME} PRIVATE _POSIX_C_SOURCE=200809)
327331
endif()
328332

vita/vita.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ set(EXECUTABLE_NAME fallout2-ce)
77
set(VITA_VERSION "01.00")
88

99
set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS}")
10-
vita_create_self(${EXECUTABLE_NAME}.self ${EXECUTABLE_NAME})
10+
11+
if(CMAKE_BUILD_TYPE STREQUAL "Release")
12+
vita_create_self(${EXECUTABLE_NAME}.self ${EXECUTABLE_NAME} STRIPPED)
13+
else()
14+
vita_create_self(${EXECUTABLE_NAME}.self ${EXECUTABLE_NAME})
15+
endif()
1116

1217
vita_create_vpk(${EXECUTABLE_NAME}.vpk ${VITA_TITLEID} ${EXECUTABLE_NAME}.self
1318
VERSION ${VITA_VERSION}

0 commit comments

Comments
 (0)