-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
46 lines (34 loc) · 1.49 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
cmake_minimum_required(VERSION 3.19.5)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
find_package(Tools MODULE)
include(CMake/pico_sdk_import.cmake)
project(Pico C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)
pico_sdk_init()
# FIXME: This is mostly necessary for the SDK
set(DISABLE_WARNINGS -Wno-unused-parameter -Wno-type-limits)
set(DISABLE_CXX_WARNINGS -Wno-reorder -Wno-ignored-qualifiers)
add_library(project_options INTERFACE)
target_compile_options(project_options INTERFACE -fdiagnostics-color=always -Wall ${DISABLE_WARNINGS} -Wextra -Werror -O0)
target_compile_options(project_options INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-frtti ${DISABLE_CXX_WARNINGS}>)
target_include_directories(project_options INTERFACE ${CMAKE_SOURCE_DIR})
add_subdirectory(Userland)
file(GLOB_RECURSE Kernel_SOURCES CONFIGURE_DEPENDS Kernel/*.cpp Kernel/*.S Std/*.cpp)
add_executable(Kernel.1 ${Kernel_SOURCES})
target_link_libraries(Kernel.1 pico_stdlib pico_bootrom hardware_dma project_options LibEmbeddedFiles)
target_compile_definitions(Kernel.1 PRIVATE KERNEL)
pico_add_extra_outputs(Kernel.1)
add_custom_target(Kernel.elf ALL
COMMAND arm-none-eabi-objcopy
--strip-symbol=__flash_data_2
--strip-symbol=__flash_data_3
--strip-symbol=__flash_data_4
--strip-symbol=__flash_data_5
--strip-symbol=__flash_base
Kernel.1.elf Kernel.elf
DEPENDS Kernel.1)