Skip to content

Commit 6182a2a

Browse files
authored
make host pico_platform.h and binary_info.h CMakeLists.txt safe for inclusion in non SDK build (#388)
* make host pico_platform.h and binary_info.h CMakeLists.txt safe for inclusion in non SDK build * fix comment
1 parent 508828f commit 6182a2a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/common/pico_binary_info/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ add_library(pico_binary_info_headers INTERFACE)
22

33
target_include_directories(pico_binary_info_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
44

5-
pico_add_impl_library(pico_binary_info)
5+
if (COMMAND pico_add_platform_library)
6+
pico_add_platform_library(pico_binary_info)
7+
else()
8+
add_library(pico_binary_info INTERFACE)
9+
endif()
610

711
target_link_libraries(pico_binary_info INTERFACE pico_binary_info_headers)
812

src/host/pico_platform/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file may be included directly by a build to get common SDK macros and types
2+
13
if (NOT TARGET pico_platform_headers)
24
add_library(pico_platform_headers INTERFACE)
35

@@ -11,7 +13,11 @@ if (NOT TARGET pico_platform_headers)
1113
endif()
1214

1315
if (NOT TARGET pico_platform)
14-
pico_add_impl_library(pico_platform)
16+
if (COMMAND pico_add_platform_library)
17+
pico_add_platform_library(pico_platform)
18+
else()
19+
add_library(pico_platform INTERFACE)
20+
endif()
1521

1622
target_sources(pico_platform INTERFACE
1723
${CMAKE_CURRENT_LIST_DIR}/platform_base.c
@@ -22,4 +28,4 @@ endif()
2228

2329
function(pico_add_platform_library TARGET)
2430
target_link_libraries(pico_platform INTERFACE ${TARGET})
25-
endfunction()
31+
endfunction()

0 commit comments

Comments
 (0)