-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
37 lines (28 loc) · 1014 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
project(z80_emulator)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -g")
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
#Link openGL library based on OS
add_executable(SDL2Test src/main.c)
if(APPLE)
target_link_libraries(SDL2Test ${SDL2_LIBRARIES} z80_lib "-framework OpenGL")
else()
target_link_libraries(SDL2Test ${SDL2_LIBRARIES} z80_lib GL)
endif()
add_executable(InstrTest src/testInstr.c)
target_link_libraries(InstrTest z80_lib)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src/instructions)
add_library(z80_lib
src/mmu.c
src/cpu.c
src/cartridge.c
src/ppu.c
${PROJECT_SOURCE_DIR}/src/Instructions/extended.c
${PROJECT_SOURCE_DIR}/src/Instructions/bitmanip.c
${PROJECT_SOURCE_DIR}/src/Instructions/arithmetic.c
${PROJECT_SOURCE_DIR}/src/Instructions/movement.c
${PROJECT_SOURCE_DIR}/src/Instructions/extended.c
src/loop.c
)
add_subdirectory(tests)