-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (35 loc) · 1.09 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
cmake_minimum_required(VERSION 3.10)
project(ByteCoreFast)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_COMPILER clang)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wunused -O3")
include_directories(src tests)
# Make clang recognize <Python.h>
find_package(Python3 REQUIRED COMPONENTS Development)
include_directories(${Python3_INCLUDE_DIRS})
set(SRC_FILES
src/memory.c
src/control_unit.c
src/emulator.c
)
set(TEST_FILES
tests/test_memory.c
tests/test_control_unit.c
tests/test_emulator.c
)
set(UNITY_FILE
tests/unity.c
)
add_executable(test_memory ${SRC_FILES} tests/test_memory.c ${UNITY_FILE})
target_link_libraries(test_memory m)
add_executable(test_control_unit ${SRC_FILES} tests/test_control_unit.c ${UNITY_FILE})
target_link_libraries(test_control_unit m)
add_executable(test_emulator ${SRC_FILES} tests/test_emulator.c ${UNITY_FILE})
target_link_libraries(test_emulator m)
add_custom_target(test ALL
COMMAND test_memory
COMMAND test_control_unit
COMMAND test_emulator
DEPENDS test_memory test_control_unit test_emulator
COMMENT "Running all tests"
)