-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
118 lines (104 loc) · 3.59 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
cmake_minimum_required(VERSION 3.16)
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
project(gameboy)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_compile_options(-Wimplicit-fallthrough -Wall -Wextra -Werror)
add_executable(gameboy
Emulator/CPU.cpp
Emulator/CPU.h
Emulator/Debugger.cpp
Emulator/Debugger.h
Emulator/Emulator.cpp
Emulator/Emulator.h
Emulator/GUI/Bitmap.h
Emulator/GUI/Rect.h
Emulator/GUI/SDLRenderer.cpp
Emulator/GUI/SDLRenderer.h
Emulator/GUI/Texture.cpp
Emulator/GUI/Texture.h
Emulator/IODevice.cpp
Emulator/IODevice.h
Emulator/InternalSDL.h
Emulator/Joypad.cpp
Emulator/Joypad.h
Emulator/MMU.cpp
Emulator/MMU.h
Emulator/MemoryMap.h
Emulator/OpCode.h
Emulator/PPU.cpp
Emulator/PPU.h
Emulator/RuntimeSettings.h
Emulator/SoundCard.cpp
Emulator/SoundCard.h
Emulator/Timer.cpp
Emulator/Timer.h
Emulator/main.cpp
SD/Bytes.h
SD/File.cpp
SD/File.h
SD/LogStream.cpp
SD/LogStream.h
SD/Option.h
SD/String.cpp
SD/Timer.h
SD/Vector.h
Emulator/InterruptFlags.h
Emulator/InterruptFlags.cpp
)
target_include_directories(gameboy PUBLIC ".")
add_executable(wavplayer
SD/File.cpp
SD/File.h
SD/LogStream.cpp
SD/LogStream.h
SD/Option.h
SD/String.cpp
SD/Vector.h
WAVPlayer/InternalSDL.h
WAVPlayer/RuntimeSettings.h
WAVPlayer/WAVFile.cpp
WAVPlayer/WAVFile.h
WAVPlayer/WAVPlayer.cpp
WAVPlayer/WAVPlayer.h
WAVPlayer/main.cpp
)
target_include_directories(wavplayer PUBLIC ".")
#---------
# Testing
#---------
add_executable(string_test Tests/TestString.cpp SD/String.cpp SD/LogStream.cpp SD/Utility.h)
target_include_directories(string_test PUBLIC ".")
# add_executable(joypad_test Tests/TestJoypadDevice.cpp SD/LogStream.cpp Emulator/Joypad.cpp Emulator/GUI/SDLRenderer.cpp Emulator/GUI/Texture.cpp SD/String.cpp)
# target_include_directories(joypad_test PUBLIC ".")
add_executable(vector_test Tests/TestVector.cpp SD/LogStream.cpp SD/String.cpp)
target_include_directories(vector_test PUBLIC ".")
#-------------
# Dependencies
#-------------
if (APPLE)
message("Configuring SDL2 for windowing on OSX")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
find_library(SDL2_LIBRARY sdl2)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)
set(SDL2_INCLUDE_DIR "/usr/local/include/SDL2")
message(" sdl2 lib path : ${SDL2_LIBRARY}")
message(" sdl2 include path : ${SDL2_INCLUDE_DIR}")
include_directories(${SDL2_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIRS})
target_link_libraries(gameboy ${SDL2_LIBRARY} ${SDL2_IMAGE_LIBRARIES} ${SDL2TTF_LIBRARY})
target_link_libraries(wavplayer ${SDL2_LIBRARY})
endif()
if (NOT APPLE)
message("Configuring SDL2 for windowing on Linux")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)
message(" sdl2 lib path : ${SDL2_LIBRARY}")
message(" sdl2 include path : ${SDL2_INCLUDE_DIR}")
include_directories(${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS})
target_link_libraries(gameboy ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2TTF_LIBRARY})
target_link_libraries(wavplayer ${SDL2_LIBRARIES})
endif()