Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

align posix cmake format #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/posix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
set(COMMON_INCLUDES
${OT_PUBLIC_INCLUDES}
${OT_PRIVATE_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/platform
${CMAKE_CURRENT_SOURCE_DIR}/platform/include
${PROJECT_SOURCE_DIR}/src/core
${PROJECT_SOURCE_DIR}/src/posix/platform
${PROJECT_SOURCE_DIR}/src/posix/platform/include
)

set(OT_READLINE "readline" CACHE STRING "set readline library name")
Expand Down
37 changes: 28 additions & 9 deletions src/posix/cli.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,22 @@ add_executable(ot-cli
$<$<BOOL:${READLINE}>:console_cli.cpp>
)

set_target_properties(
ot-cli
set_target_properties(ot-cli
PROPERTIES
C_STANDARD 99
CXX_STANDARD 11
)

target_include_directories(ot-cli PRIVATE ${COMMON_INCLUDES})

target_compile_definitions(ot-cli PRIVATE
$<$<BOOL:${READLINE}>:HAVE_LIB$<UPPER_CASE:${OT_READLINE}>=1>
OPENTHREAD_POSIX_APP_TYPE=OT_POSIX_APP_TYPE_CLI
${OT_PLATFORM_DEFINES}
target_compile_definitions(ot-cli
PRIVATE
$<$<BOOL:${READLINE}>:HAVE_LIB$<UPPER_CASE:${OT_READLINE}>=1>
OPENTHREAD_POSIX_APP_TYPE=OT_POSIX_APP_TYPE_CLI
${OT_PLATFORM_DEFINES}
)

target_compile_options(ot-cli PRIVATE
${OT_CFLAGS}
)
target_compile_options(ot-cli PRIVATE ${OT_CFLAGS})

target_link_libraries(ot-cli
openthread-cli-ftd
Expand All @@ -62,6 +60,27 @@ target_link_libraries(ot-cli
${READLINE_LINK_LIBRARIES}
)

add_executable(ot-ncp
main.c
)

set_target_properties(ot-ncp
PROPERTIES
C_STANDARD 99
CXX_STANDARD 11
)

target_include_directories(ot-ncp PRIVATE ${COMMON_INCLUDES})

target_compile_definitions(ot-ncp
PRIVATE
OPENTHREAD_POSIX_APP_TYPE=OT_POSIX_APP_TYPE_NCP
${OT_PLATFORM_DEFINES}
)

target_compile_options(ot-ncp PRIVATE ${OT_CFLAGS})
>>>>>>> 52eb81202... align posix cmake format:src/posix/standalone.cmake


install(TARGETS ot-cli DESTINATION bin)

43 changes: 20 additions & 23 deletions src/posix/daemon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,52 +30,49 @@ add_executable(ot-daemon
main.c
)

set_target_properties(
ot-daemon
set_target_properties(ot-daemon
PROPERTIES
C_STANDARD 99
CXX_STANDARD 11
)

target_include_directories(ot-daemon PRIVATE ${COMMON_INCLUDES})

target_compile_definitions(ot-daemon PRIVATE
OPENTHREAD_POSIX_APP_TYPE=OT_POSIX_APP_TYPE_CLI
${OT_PLATFORM_DEFINES}
target_compile_definitions(ot-daemon
PRIVATE
OPENTHREAD_POSIX_APP_TYPE=OT_POSIX_APP_TYPE_CLI
${OT_PLATFORM_DEFINES}
)

target_compile_options(ot-daemon PRIVATE
${OT_CFLAGS}
)
target_compile_options(ot-daemon PRIVATE ${OT_CFLAGS})

target_link_libraries(ot-daemon PRIVATE
openthread-cli-ftd
${OT_PLATFORM_LIB}
openthread-ftd
${OT_PLATFORM_LIB}
openthread-ncp-ftd
mbedcrypto
target_link_libraries(ot-daemon
PRIVATE
openthread-cli-ftd
${OT_PLATFORM_LIB}
openthread-ftd
${OT_PLATFORM_LIB}
openthread-ncp-ftd
mbedcrypto
)

add_executable(ot-ctl
client.cpp
)

set_target_properties(
ot-ctl
set_target_properties(ot-ctl
PROPERTIES
C_STANDARD 99
CXX_STANDARD 11
)

target_compile_definitions(ot-ctl PRIVATE
$<$<BOOL:${READLINE}>:HAVE_LIB$<UPPER_CASE:${OT_READLINE}>=1>
${OT_PLATFORM_DEFINES}
target_compile_definitions(ot-ctl
PRIVATE
$<$<BOOL:${READLINE}>:HAVE_LIB$<UPPER_CASE:${OT_READLINE}>=1>
${OT_PLATFORM_DEFINES}
)

target_compile_options(ot-ctl PRIVATE
${OT_CFLAGS}
)
target_compile_options(ot-ctl PRIVATE ${OT_CFLAGS})

target_link_libraries(ot-ctl
openthread-platform
Expand Down
31 changes: 15 additions & 16 deletions src/posix/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ add_library(openthread-posix
virtual_time.cpp
)

set_target_properties(
openthread-posix
set_target_properties(openthread-posix
PROPERTIES
C_STANDARD 99
CXX_STANDARD 11
)

target_link_libraries(openthread-posix PUBLIC
openthread-platform
ot-config
util
target_link_libraries(openthread-posix
PUBLIC
openthread-platform
ot-config
util
)

target_compile_definitions(openthread-posix
Expand All @@ -95,16 +95,15 @@ target_compile_definitions(openthread-posix
${OT_PLATFORM_DEFINES}
)

target_compile_options(openthread-posix PRIVATE
${OT_CFLAGS}
)
target_compile_options(openthread-posix PRIVATE ${OT_CFLAGS})

target_include_directories(openthread-posix PRIVATE
${OT_PUBLIC_INCLUDES}
${OT_PRIVATE_INCLUDES}
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/core
${PROJECT_SOURCE_DIR}/third_party/mbedtls/repo/include
target_include_directories(openthread-posix
PUBLIC
${PROJECT_SOURCE_DIR}/src/posix/platform/include
${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE
${OT_PUBLIC_INCLUDES}
${OT_PRIVATE_INCLUDES}
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/core
${PROJECT_SOURCE_DIR}/third_party/mbedtls/repo/include
)