-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (41 loc) · 1.51 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
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
project(BoxLambda VERSION 0.1.0 LANGUAGES C CXX ASM)
#Add the cmake subdirectory to CMake's module path. The ASM_PICO dialect is defined there.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
#Enable picorv32 assembler dialect, associated with .picoasm file extension.
#We want to keep this separate from the regular host processor assembler settings associated
#with .s and .S files.
enable_language(ASM_PICO)
#Build systems like Ninja can handle multiple configurations in one build tree.
#We currently don't support that.
get_property(isMultiConfig GLOBAL
PROPERTY GENERATOR_IS_MULTI_CONFIG
)
if(isMultiConfig)
message(FATAL_ERROR "MultiConfig is not supported.")
endif()
#Currently, two build types are supported: -DCMAKE_BUILD_TYPE=fpga and -DCMAKE_BUILD_TYPE=sim
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
STRINGS fpga sim)
set(allowedBuildTypes fpga sim)
if(NOT CMAKE_BUILD_TYPE IN_LIST allowedBuildTypes)
message(FATAL_ERROR "${CMAKE_BUILD_TYPE} is not a known build type.")
endif()
message("Build Type: ${CMAKE_BUILD_TYPE}.")
#make regen rule, to complete remove and regenerate the build tree.
add_custom_target(regen
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
COMMAND
rm -rf sw && rm -rf gw
COMMAND
${CMAKE_COMMAND} .
COMMENT
"Removing and regenerating build tree."
VERBATIM
)
enable_testing()
#The software tree
add_subdirectory(sw)
#The gateware tree
add_subdirectory(gw)