-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (33 loc) · 1.11 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
37
38
39
40
41
42
43
cmake_minimum_required(VERSION 3.21)
project(PSXEngine
LANGUAGES C CXX ASM
VERSION 0.1.0
DESCRIPTION "Platformer Engine for PSX"
HOMEPAGE_URL "https://luksamuk.codes")
file(GLOB ENGINE_SRC
${CMAKE_CURRENT_LIST_DIR}/src/*.c
${CMAKE_CURRENT_LIST_DIR}/src/*.s)
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_LIST_DIR}/cmake/")
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_get_exact_tag(GIT_TAG)
string(SUBSTRING "${GIT_SHA1}" 0 7 GIT_SHORTHASH)
string(SUBSTRING "${GIT_REFSPEC}" 11 -1 GIT_BRANCH)
add_definitions("-DGIT_SHA1=\"${GIT_SHA1}\"")
add_definitions("-DGIT_REFSPEC=\"${GIT_REFSPEC}\"")
add_definitions("-DGIT_COMMIT=\"${GIT_BRANCH}/${GIT_SHORTHASH}\"")
if(GIT_TAG)
add_definitions("-DGIT_VERSION=\"${GIT_TAG}\"")
else()
add_definitions("-DGIT_VERSION=\"DEV BUILD ${GIT_SHORTHASH}\"")
endif()
set(CMAKE_C_FLAGS "-Wall")
psn00bsdk_add_executable(engine
GPREL
${ENGINE_SRC})
target_include_directories(engine PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/>)
psn00bsdk_add_cd_image(iso engine
iso.xml
DEPENDS engine system.cnf)