-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
executable file
·59 lines (48 loc) · 1.37 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
cmake_minimum_required(VERSION 3.0.2)
project(nesemu)
# Set C++ version
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
option(DEBUG "Enable DEBUG mode" OFF)
if (DEBUG)
add_definitions(-DDEBUG=1)
endif()
# Load SDL2
find_package(SDL2 REQUIRED)
###########
## Build ##
###########
# Specify header include paths
include_directories(include ${SDL2_INCLUDE_DIRS})
add_executable(${PROJECT_NAME}
src/hw/apu/apu.cpp
src/hw/apu/channels/dmc.cpp
src/hw/apu/channels/noise.cpp
src/hw/apu/channels/square.cpp
src/hw/apu/channels/triangle.cpp
src/hw/apu/units.cpp
src/hw/console.cpp
src/hw/cpu.cpp
src/hw/joystick.cpp
src/hw/ppu.cpp
src/hw/rom.cpp
src/hw/system_bus.cpp
src/logger.cpp
src/ui/nametable_viewer.cpp
src/ui/pattern_table_viewer.cpp
src/ui/screen.cpp
src/ui/speaker.cpp
src/ui/sprite_viewer.cpp
src/ui/window.cpp
src/nesemu.cpp
)
target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES})
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror=switch)
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<CONFIG:DEBUG>:-g>")
target_compile_options(${PROJECT_NAME} PRIVATE "$<$<CONFIG:RELEASE>:-O3>")
#############
## Install ##
#############
# Install targets
install(TARGETS ${PROJECT_NAME} DESTINATION bin)