Skip to content

Commit

Permalink
cmake: Remove unneeded function for shared sources
Browse files Browse the repository at this point in the history
This function is not needed anymore as Wakaama is now a proper library.
Additional functions can be added to the library at configure time.
  • Loading branch information
LukasWoodtli committed Dec 4, 2024
1 parent 158bced commit 9c66532
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions wakaama.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -296,33 +296,6 @@ target_include_directories(wakaama_transport_testing_fake PUBLIC ${WAKAAMA_TOP_L
target_include_directories(wakaama_transport_testing_fake PRIVATE ${WAKAAMA_TOP_LEVEL_DIRECTORY}/include/)
target_sources(wakaama_transport_testing_fake PRIVATE ${WAKAAMA_TOP_LEVEL_DIRECTORY}/tests/helper/connection.c)

# Add shared source files to an existing target.
function(target_sources_shared target)
get_target_property(TARGET_PROPERTY_CONN_IMPL ${target} CONNECTION_IMPLEMENTATION)

if(WAKAAMA_PLATFORM STREQUAL POSIX)
target_link_libraries(${target} PRIVATE wakaama_command_line wakaama_platform_posix)
endif()

if(WAKAAMA_CLI)
target_link_libraries(${target} PRIVATE wakaama_command_line)
endif()

set_defines(${target})

if(NOT TARGET_PROPERTY_CONN_IMPL OR WAKAAMA_TRANSPORT STREQUAL POSIX_UDP)
target_link_libraries(${target} PRIVATE wakaama_transport_posix_udp)
elseif(TARGET_PROPERTY_CONN_IMPL MATCHES "tinydtls" OR WAKAAMA_TRANSPORT STREQUAL TINYDTLS)
target_link_libraries(${target} PRIVATE wakaama_transport_tinydtls)
else()
message(
FATAL_ERROR "${target}: Unknown connection (DTLS) implementation '${TARGET_PROPERTY_CONN_IMPL} requested"
)
endif()

target_include_directories(${target} PUBLIC ${WAKAAMA_EXAMPLE_SHARED_DIRECTORY})
endfunction()

# Static library that users of Wakaama can link against
#
# This library simplifies building and maintaining Wakaama. It handles defines and compiler flags, adding the right
Expand Down

0 comments on commit 9c66532

Please sign in to comment.