[cmake] add external platform support (#5693)

This commit adds external platform support into cmake build system.
This commit is contained in:
Yakun Xu
2020-10-23 22:23:00 +08:00
committed by GitHub
parent aaf553ee7d
commit f83d1ff999
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -152,6 +152,8 @@ list(APPEND OT_PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/include)
if(OT_PLATFORM STREQUAL "posix")
target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/src/posix/platform)
add_subdirectory("${PROJECT_SOURCE_DIR}/src/posix/platform")
elseif(OT_PLATFORM STREQUAL "external")
# skip in this case
elseif(OT_PLATFORM)
target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/examples/platforms/${OT_PLATFORM})
add_subdirectory("${PROJECT_SOURCE_DIR}/examples/platforms/${OT_PLATFORM}")
+1 -1
View File
@@ -28,7 +28,7 @@
# Get a list of the available platforms and output as a list to the 'arg_platforms' argument
function(ot_get_platforms arg_platforms)
list(APPEND result "NO" "posix")
list(APPEND result "NO" "posix" "external")
set(platforms_dir "${PROJECT_SOURCE_DIR}/examples/platforms")
file(GLOB platforms RELATIVE "${platforms_dir}" "${platforms_dir}/*")
foreach(platform IN LISTS platforms)