forked from LBALab/lba2-classic-community
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
40 lines (33 loc) · 1.43 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
cmake_minimum_required(VERSION 3.23)
project(LBA2)
# Bruteforce setup of UASM assembly compiler (must happen before enable_language)
set(CMAKE_ASM_MASM_COMPILER uasm)
set(CMAKE_ASM_MASM_FLAGS_INIT "-D_WIN32 -Zm -c -Cx -Cp -W4 -nologo -Sg -Sa -Zd")
if (WIN32)
set(CMAKE_ASM_MASM_FLAGS_INIT ${CMAKE_ASM_MASM_FLAGS_INIT}" -coff")
else ()
set(CMAKE_ASM_MASM_FLAGS_INIT ${CMAKE_ASM_MASM_FLAGS_INIT}" -elf -zcw")
endif ()
enable_language(C CXX ASM_MASM)
set(CMAKE_CXX_STANDARD 98)
# Compilation options
set(SOUND_BACKEND "none" CACHE STRING "Sound backend to be used")
set(MVIDEO_BACKEND "none" CACHE STRING "Motion Video backend to be used")
# Compilation options sanitization
## Sound backend
set(SOUND_BACKEND_OPTIONS miles none)
set_property(CACHE SOUND_BACKEND PROPERTY STRINGS ${SOUND_BACKEND_OPTIONS})
if (NOT SOUND_BACKEND IN_LIST SOUND_BACKEND_OPTIONS)
message(SEND_ERROR "SOUND_BACKEND set with invalid option '${SOUND_BACKEND}'. Valid options are: ${SOUND_BACKEND_OPTIONS}")
endif ()
## Motion Video backend
set(MVIDEO_BACKEND_OPTIONS smacker none)
set_property(CACHE MVIDEO_BACKEND PROPERTY STRINGS ${MVIDEO_BACKEND_OPTIONS})
if (NOT MVIDEO_BACKEND IN_LIST MVIDEO_BACKEND_OPTIONS)
message(SEND_ERROR "MVIDEO_BACKEND set with invalid option '${MVIDEO_BACKEND}'. Valid options are: ${MVIDEO_BACKEND_OPTIONS}")
endif ()
# Dependencies
find_package(SDL2 REQUIRED)
# Process the targets
add_subdirectory(LIB386)
add_subdirectory(SOURCES)