From 6182a2a0783a8350aaa34c79ac9e2f3ba56a48a5 Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Tue, 11 May 2021 10:37:49 -0500 Subject: [PATCH] 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 --- src/common/pico_binary_info/CMakeLists.txt | 6 +++++- src/host/pico_platform/CMakeLists.txt | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/common/pico_binary_info/CMakeLists.txt b/src/common/pico_binary_info/CMakeLists.txt index ebc57ca..eb0c3f6 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 c73b472..c78e330 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 @@ -22,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()