-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
36 lines (29 loc) · 1.27 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
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.14)
set(CMAKE_C_STANDARD 11)
set(ENVSDK $ENV{PLAYDATE_SDK_PATH})
if (NOT ${ENVSDK} STREQUAL "")
# Convert path from Windows
file(TO_CMAKE_PATH ${ENVSDK} SDK)
else()
execute_process(
COMMAND bash -c "egrep '^\\s*SDKRoot' $HOME/.Playdate/config"
COMMAND head -n 1
COMMAND cut -c9-
OUTPUT_VARIABLE SDK
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
if (NOT EXISTS ${SDK})
message(FATAL_ERROR "SDK Path not found; set ENV value PLAYDATE_SDK_PATH")
return()
endif()
# Game Name Customization
set(PLAYDATE_GAME_NAME Playnote)
set(PLAYDATE_GAME_DEVICE Playnote_DEVICE)
project(${PLAYDATE_GAME_NAME} C ASM)
if (TOOLCHAIN STREQUAL "armgcc")
add_executable(${PLAYDATE_GAME_DEVICE} ${SDK}/C_API/buildsupport/setup.c extension/main.c ppmlib/utils.c ppmlib/ppm.c ppmlib/tmb.c ppmlib/audio.c ppmlib/video.c ppmlib/ppmlib.c ppmlib/tmblib.c ppmlib/player.c)
else()
add_library(${PLAYDATE_GAME_NAME} SHARED extension/main.c ppmlib/utils.c ppmlib/ppm.c ppmlib/tmb.c ppmlib/audio.c ppmlib/video.c ppmlib/ppmlib.c ppmlib/tmblib.c ppmlib/player.c)
endif()
include(${SDK}/C_API/buildsupport/playdate_game.cmake)