forked from foreverska/littlerisc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
30 lines (22 loc) · 848 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
cmake_minimum_required(VERSION 2.8)
enable_testing()
set(CMAKE_C_FLAGS_DEBUG "-g -Og")
set(CMAKE_C_FLAGS_RELEASE "-O3")
file(GLOB LIB_SOURCES littlerisc/*.c littlerisc/*.h littlerisc/include/*.h)
add_library(littlerisc ${LIB_SOURCES})
add_executable(register_test test/register_test.c)
target_link_libraries(register_test littlerisc)
add_test(register register_test)
add_executable(mmu_test test/mmu_test.c)
target_link_libraries(mmu_test littlerisc)
add_test(mmu mmu_test)
add_executable(rv32i_test test/rv32i_test.c)
target_link_libraries(rv32i_test littlerisc)
add_test(rv32i rv32i_test)
add_executable(csr_test test/csr_test.c)
target_link_libraries(csr_test littlerisc)
add_test(csr csr_test)
project(riscv_emu)
include_directories(libriscv/include)
add_executable(${PROJECT_NAME} "main.c")
target_link_libraries(riscv_emu littlerisc)