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
This commit is contained in:
Graham Sanderson 2021-05-11 10:37:49 -05:00 committed by GitHub
parent 508828f8ea
commit 6182a2a078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -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)

View File

@ -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