forked from raspberrypi/pico-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
44 lines (35 loc) · 1.46 KB
/
CMakeLists.txt
File metadata and controls
44 lines (35 loc) · 1.46 KB
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
if (NOT TARGET pico_platform)
pico_add_library(pico_platform)
target_sources(pico_platform INTERFACE
${CMAKE_CURRENT_LIST_DIR}/platform.c
)
target_compile_definitions(pico_platform_headers INTERFACE
PICO_NO_HARDWARE=0
PICO_ON_DEVICE=1
PICO_BUILD=1
PICO_RP2040=1
PICO_32BIT=1
)
target_include_directories(pico_platform_headers SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
target_link_libraries(pico_platform_headers INTERFACE hardware_regs)
pico_mirrored_target_link_libraries(pico_platform INTERFACE
pico_platform_common
pico_platform_compiler
pico_platform_panic
pico_platform_sections
)
pico_register_common_scope_var(PICO_LINKER_SCRIPT_PATH)
if (NOT PICO_LINKER_SCRIPT_PATH)
set(PICO_LINKER_SCRIPT_PATH ${CMAKE_CURRENT_LIST_DIR})
endif()
pico_register_common_scope_var(PICO_LINKER_DEFAULT_LOCATIONS_PATH)
if (NOT PICO_LINKER_DEFAULT_LOCATIONS_PATH)
set(PICO_LINKER_DEFAULT_LOCATIONS_PATH ${CMAKE_CURRENT_LIST_DIR}/script_include/default_locations.ld)
endif()
pico_register_common_scope_var(PICO_LINKER_SCRIPT_INCLUDE_DIRS)
list(APPEND PICO_LINKER_SCRIPT_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/script_include)
pico_promote_common_scope_vars()
endif()
function(pico_add_platform_library TARGET)
target_link_libraries(pico_platform INTERFACE ${TARGET})
endfunction()