From 23f2c9b0b8db99769938abb928ef7a2eb6718675 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Thu, 6 May 2021 12:10:09 -0500 Subject: [PATCH 1/2] make host pico_platform.h and binary_info.h CMakeLists.txt safe for inclusion in non SDK build --- src/common/pico_binary_info/CMakeLists.txt | 6 +++++- src/host/pico_platform/CMakeLists.txt | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/common/pico_binary_info/CMakeLists.txt b/src/common/pico_binary_info/CMakeLists.txt index ebc57ca63..eb0c3f66b 100644 --- a/src/common/pico_binary_info/CMakeLists.txt +++ b/src/common/pico_binary_info/CMakeLists.txt @@ -2,7 +2,11 @@ add_library(pico_binary_info_headers INTERFACE) target_include_directories(pico_binary_info_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include) -pico_add_impl_library(pico_binary_info) +if (COMMAND pico_add_platform_library) + pico_add_platform_library(pico_binary_info) +else() + add_library(pico_binary_info INTERFACE) +endif() target_link_libraries(pico_binary_info INTERFACE pico_binary_info_headers) diff --git a/src/host/pico_platform/CMakeLists.txt b/src/host/pico_platform/CMakeLists.txt index c73b47252..0877bb54c 100644 --- a/src/host/pico_platform/CMakeLists.txt +++ b/src/host/pico_platform/CMakeLists.txt @@ -1,3 +1,5 @@ +# This file may be included directly by a build to get common SDK macros and types */ + if (NOT TARGET pico_platform_headers) add_library(pico_platform_headers INTERFACE) @@ -11,7 +13,11 @@ if (NOT TARGET pico_platform_headers) endif() if (NOT TARGET pico_platform) - pico_add_impl_library(pico_platform) + if (COMMAND pico_add_platform_library) + pico_add_platform_library(pico_platform) + else() + add_library(pico_platform INTERFACE) + endif() target_sources(pico_platform INTERFACE ${CMAKE_CURRENT_LIST_DIR}/platform_base.c From bc8c782a6cb7eb09d8ccf590a879193949d2d026 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Tue, 11 May 2021 10:36:13 -0500 Subject: [PATCH 2/2] fix comment --- src/host/pico_platform/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/host/pico_platform/CMakeLists.txt b/src/host/pico_platform/CMakeLists.txt index 0877bb54c..c78e330bc 100644 --- a/src/host/pico_platform/CMakeLists.txt +++ b/src/host/pico_platform/CMakeLists.txt @@ -1,4 +1,4 @@ -# This file may be included directly by a build to get common SDK macros and types */ +# This file may be included directly by a build to get common SDK macros and types if (NOT TARGET pico_platform_headers) add_library(pico_platform_headers INTERFACE) @@ -28,4 +28,4 @@ endif() function(pico_add_platform_library TARGET) target_link_libraries(pico_platform INTERFACE ${TARGET}) -endfunction() \ No newline at end of file +endfunction()