aboutsummaryrefslogtreecommitdiff
path: root/cmake/ps1.cmake
blob: 14b6937d090127cfc3761ac9a278cab3a0ed28f5 (plain) (blame)
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
30
31
32
33
34
add_custom_target(exe ALL ${TOOLS_PREFIX}/bin/elf2exe ${PROJECT_NAME}
    ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.exe
        -mark="wnix, a Unix-like operating system for WebAssembly applications"
    DEPENDS ${PROJECT_NAME})
add_dependencies(exe tools)

if(VIDEO_MODE STREQUAL "VMODE_PAL")
    set(region eur)
elseif(VIDEO_MODE STREQUAL "VMODE_NTSC")
    set(ntsc_regions usa jap)

    if(NOT NTSC_REGION IN_LIST ntsc_regions)
        message(FATAL_ERROR "Please define valid NTSC_REGION. Available options:\n"
            "${ntsc_regions}\n"
            "Run CMake again using one of the available options above e.g.:\n"
            "cmake .. [options] -DNTSC_REGION=US")
    endif()

    set(region ${NTSC_REGION})
endif()

add_custom_target(bin_cue ALL
    ${TOOLS_PREFIX}/bin/mkpsxiso -q ${CMAKE_BINARY_DIR}/wnix.xml
    WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

add_dependencies(bin_cue exe tools)

set(cflags ${cflags})

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(cflags ${cflags} -Og)
else()
    set(cflags ${cflags} -O3 -g)
endif()