-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
82 lines (72 loc) · 1.81 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
cmake_minimum_required(VERSION 3.1)
project(heliage-advance)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(HA_FRONTEND "SDL2" CACHE STRING "The frontend heliage-advance will run on")
set_property(CACHE HA_FRONTEND PROPERTY STRINGS SDL2 Null)
if (${HA_FRONTEND} MATCHES "SDL2")
find_package(SDL2 REQUIRED)
add_compile_definitions("HA_FRONTEND_SDL")
endif()
add_compile_options(
-Wall
-Wextra
-Wpedantic
-Wshadow
)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(
-Wno-gnu-zero-variadic-macro-arguments
)
endif()
set(SOURCES
src/arm7/arm7.cpp
src/arm7/disassembler.cpp
src/arm7/arm/arm.cpp
src/arm7/arm/branch.cpp
src/arm7/arm/data_processing.cpp
src/arm7/thumb/branch.cpp
src/arm7/thumb/thumb.cpp
src/bios.cpp
src/bus.cpp
src/cartridge.cpp
src/gba.cpp
src/main.cpp
src/ppu.cpp
src/timer.cpp
)
set(HEADERS
src/common/bits.h
src/common/defines.h
src/common/logging.h
src/common/types.h
src/arm7/arm7.h
src/bios.h
src/bus.h
src/cartridge.h
src/gba.h
src/keypad.h
src/ppu.h
src/timer.h
)
if (${HA_FRONTEND} MATCHES "SDL2")
set(SOURCES ${SOURCES} "src/frontend/sdl.cpp")
set(HEADERS ${HEADERS} "src/frontend/sdl.h")
else()
set(SOURCES ${SOURCES} "src/frontend/null.cpp")
set(HEADERS ${HEADERS} "src/frontend/null.h")
endif()
add_subdirectory(dependencies/range-v3)
add_subdirectory(dependencies/fmt)
add_executable(heliage-advance ${SOURCES} ${HEADERS})
target_include_directories(heliage-advance PRIVATE
src
dependencies
dependencies/range-v3/include
dependencies/fmt
)
target_link_libraries(heliage-advance fmt)
if (${HA_FRONTEND} MATCHES "SDL2")
target_link_libraries(heliage-advance SDL2)
endif()