Skip to content

Commit

Permalink
Merge branch 'main' into dev-frame-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-josi-aws committed Mar 14, 2024
2 parents ddd8eb6 + 8d95eaf commit 6392cb9
Show file tree
Hide file tree
Showing 21 changed files with 143 additions and 429 deletions.
61 changes: 5 additions & 56 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ set(FREERTOS_PLUS_TCP_NETWORK_IF_LIST
ESP32
KSZ8851SNL
LIBSLIRP
LOOPBACK
LPC17xx LPC18xx LPC54018
M487
MPS2_AN385
MPS3_AN552
MW300_RD
NXP1060
PIC32MZEF_ETH PIC32MZEF_WIFI
POSIX WIN_PCAP # Native Linux & Windows respectively
RX
Expand All @@ -73,6 +75,7 @@ set(FREERTOS_PLUS_TCP_NETWORK_IF_LIST
TM4C
XILINX_ULTRASCALE ZYNQ # AMD/Xilinx
)

if(NOT FREERTOS_PLUS_TCP_NETWORK_IF)
# Attempt to detect the system.
if(UNIX)
Expand Down Expand Up @@ -100,13 +103,15 @@ if(NOT FREERTOS_PLUS_TCP_NETWORK_IF IN_LIST FREERTOS_PLUS_TCP_NETWORK_IF_LIST )
" KSZ8851SNL Target: ksz8851snl Tested: TODO\n"
" LIBSLIRP Target: libslirp Tested: TODO\n"
" POSIX Target: linux/Posix\n"
" LOOPBACK Target: loopback Tested: TODO\n"
" LPC17xx Target: LPC17xx Tested: TODO\n"
" LPC18xx Target: LPC18xx Tested: TODO\n"
" LPC54018 Target: LPC54018 Tested: TODO\n"
" M487 Target: M487 Tested: TODO\n"
" MPS2_AN385 Target: MPS2_AN385 Tested: TODO\n"
" MPS3_AN552 Target: MPS3_AN552"
" MW300_RD Target: mw300_rd Tested: TODO\n"
" NXP1060 Target: NXP1060 Tested: TODO\n"
" PIC32MZEF_ETH Target: pic32mzef ethernet Tested: TODO\n"
" PIC32MZEF_WIFI Target: pic32mzef Wifi Tested: TODO\n"
" RX Target: RX Tested: TODO\n"
Expand Down Expand Up @@ -171,54 +176,6 @@ else()
endif()
endif()

########################################################################
# Overall Compile Options
# Note the compile option strategy is to error on everything and then
# Per library opt-out of things that are warnings/errors.
# This ensures that no matter what strategy for compilation you take, the
# builds will still occur.
#
# Only tested with GNU and Clang.
# Other options are https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html#variable:CMAKE_%3CLANG%3E_COMPILER_ID
# Naming of compilers translation map:
# For the ?TBD? - Suggest trying GNU-based and adding the appropriate toolchain file.
# For Toolchain examples see _deps/cmake-src/toolchain/arm-none-eabil-gcc.toolchain.cmake
#
# FreeRTOS | CMake
# -------------------
# CCS | ?TBD?
# GCC | GNU, Clang, *Clang Others?
# IAR | IAR
# Keil | ARMCC
# MSVC | MSVC # Note only for MinGW?
# Renesas | ?TBD?

add_compile_options(
### Gnu/Clang C Options
$<$<COMPILE_LANG_AND_ID:C,GNU>:-fdiagnostics-color=always>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-fcolor-diagnostics>

$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wall>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wpedantic>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wconversion>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wunused-variable>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>

# Suppressions required to build clean with clang.
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-unused-macros>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-qual>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-switch-enum>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-declaration-after-statement>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-padded>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-variable-declarations>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-covered-switch-default>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-extra-semi-stmt>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-noreturn>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-align>
)

########################################################################
# External Dependencies
# Note: For backwards compatibility - still have .gitmodules defining submodules
Expand All @@ -243,11 +200,3 @@ add_subdirectory(tools)
add_subdirectory(test)

FetchContent_MakeAvailable(freertos_kernel cmock)

# Note following are can be removed once FreeRTOS-Kernel v10.5.0 + fixes their issues.
# To ignore header specific issues - change all of the headers to SYSTEM
set(_freertos_kernel_targets freertos_kernel freertos_kernel_port)
# foreach (_target ${_freertos_kernel_targets} )
# get_target_property( interface_directories ${_target} INTERFACE_INCLUDE_DIRECTORIES )
# set_target_properties(${_target} PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${interface_directories}" )
# endforeach()
4 changes: 2 additions & 2 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ set_property(TARGET freertos_plus_tcp PROPERTY C_STANDARD 90)

target_sources( freertos_plus_tcp
PRIVATE
include/FreeRTOSIPConfigDefaults.h
include/FreeRTOSIPDeprecatedDefinitions.h
include/FreeRTOS_ARP.h
include/FreeRTOS_BitConfig.h
include/FreeRTOS_DHCP.h
Expand Down Expand Up @@ -41,6 +39,8 @@ target_sources( freertos_plus_tcp
include/FreeRTOS_TCP_Utils.h
include/FreeRTOS_TCP_WIN.h
include/FreeRTOS_UDP_IP.h
include/FreeRTOSIPConfigDefaults.h
include/FreeRTOSIPDeprecatedDefinitions.h
include/IPTraceMacroDefaults.h
include/NetworkBufferManagement.h
include/NetworkInterface.h
Expand Down
2 changes: 2 additions & 0 deletions source/portable/NetworkInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ add_subdirectory(esp32)
add_subdirectory(ksz8851snl)
add_subdirectory(libslirp)
add_subdirectory(linux)
add_subdirectory(loopback)
add_subdirectory(LPC17xx)
add_subdirectory(LPC18xx)
add_subdirectory(LPC54018)
add_subdirectory(M487)
add_subdirectory(MPS2_AN385)
add_subdirectory(MPS3_AN552)
add_subdirectory(NXP1060)
add_subdirectory(mw300_rd)
add_subdirectory(pic32mzef)
add_subdirectory(RX)
Expand Down
20 changes: 20 additions & 0 deletions source/portable/NetworkInterface/NXP1060/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "NXP1060") )
return()
endif()

#------------------------------------------------------------------------------
add_library( freertos_plus_tcp_network_if STATIC )

target_sources( freertos_plus_tcp_network_if
PRIVATE
NetworkInterface.c
)

target_link_libraries( freertos_plus_tcp_network_if
PUBLIC
freertos_plus_tcp_port
freertos_plus_tcp_network_if_common
PRIVATE
freertos_kernel
freertos_plus_tcp
)
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/Zynq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ target_link_libraries(freertos_xil_uncached_memory

#------------------------------------------------------------------------------
add_library( freertos_plus_tcp_network_if STATIC )
set_property(TARGET freertos_plus_tcp_network_if PROPERTY C_STANDARD 99)
set_property(TARGET freertos_plus_tcp_network_if PROPERTY C_STANDARD 90)

target_sources( freertos_plus_tcp_network_if
PRIVATE
Expand Down
20 changes: 20 additions & 0 deletions source/portable/NetworkInterface/loopback/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "LOOPBACK") )
return()
endif()

#------------------------------------------------------------------------------
add_library( freertos_plus_tcp_network_if STATIC )

target_sources( freertos_plus_tcp_network_if
PRIVATE
loopbackNetworkInterface.c
)

target_link_libraries( freertos_plus_tcp_network_if
PUBLIC
freertos_plus_tcp_port
freertos_plus_tcp_network_if_common
PRIVATE
freertos_kernel
freertos_plus_tcp
)
2 changes: 1 addition & 1 deletion test/Coverity/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Minimum required version of CMake
cmake_minimum_required ( VERSION 3.13.0 )
cmake_minimum_required ( VERSION 3.15.0 )

# Name of the project
project ( "FreeRTOS+TCP Static analysis"
Expand Down
29 changes: 29 additions & 0 deletions test/build-combination/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,35 @@ else()
add_library( freertos_config ALIAS freertos_plus_tcp_config_default)
endif()

# FreeRTOS-Plus-TCP compilation options configuration
target_compile_options(freertos_plus_tcp
PRIVATE

### Gnu/Clang C Options
$<$<COMPILE_LANG_AND_ID:C,GNU>:-fdiagnostics-color=always>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-fcolor-diagnostics>

$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wall>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wpedantic>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wconversion>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wunused-variable>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>

# Suppressions required to build clean with clang.
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-unused-macros>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-qual>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-switch-enum>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-declaration-after-statement>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-padded>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-variable-declarations>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-covered-switch-default>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-extra-semi-stmt>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-noreturn>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-align>
)

# Common build combination test.
add_executable(freertos_plus_tcp_build_test EXCLUDE_FROM_ALL)

Expand Down
67 changes: 37 additions & 30 deletions test/unit-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set the required version.
cmake_minimum_required( VERSION 3.13.0 )
cmake_minimum_required( VERSION 3.15.0 )

# Set the unit-test project.
project( "FreeRTOS-Plus-TCP test"
Expand Down Expand Up @@ -311,40 +311,40 @@ include( ${UNIT_TEST_DIR}/FreeRTOS_Routing_ConfigCompatibleWithSingle/ut.cmake )
add_custom_target( coverage
COMMAND ${CMAKE_COMMAND} -P ${MODULE_ROOT_DIR}/test/unit-test/cmock/coverage.cmake
DEPENDS cmock unity
FreeRTOS_ARP_utest
FreeRTOS_ARP_utest
FreeRTOS_ARP_DataLenLessThanMinPacket_utest
FreeRTOS_BitConfig_utest
FreeRTOS_DHCP_utest
FreeRTOS_DHCPv6_utest
FreeRTOS_UDP_IP_utest
FreeRTOS_UDP_IPv4_utest
FreeRTOS_UDP_IPv6_utest
FreeRTOS_DNS_utest
FreeRTOS_DNS_Cache_utest
FreeRTOS_DNS_Callback_utest
FreeRTOS_DNS_ConfigNoCallback_utest
FreeRTOS_DNS_Networking_utest
FreeRTOS_DNS_Parser_utest
FreeRTOS_ICMP_utest
FreeRTOS_ICMP_wo_assert_utest
FreeRTOS_IP_utest
FreeRTOS_IP_DiffConfig_utest
FreeRTOS_IP_DiffConfig1_utest
FreeRTOS_IP_DiffConfig2_utest
FreeRTOS_IP_DiffConfig3_utest
FreeRTOS_ICMP_utest
FreeRTOS_IP_Timers_utest
FreeRTOS_IP_Utils_utest
FreeRTOS_IP_Utils_DiffConfig_utest
FreeRTOS_IPv4_utest
FreeRTOS_IPv4_DiffConfig_utest
FreeRTOS_IPv4_DiffConfig1_utest
FreeRTOS_IPv4_Sockets_utest
FreeRTOS_IPv4_Utils_utest
FreeRTOS_IPv6_utest
FreeRTOS_IPv6_ConfigDriverCheckChecksum_utest
FreeRTOS_IPv6_Utils_utest
FreeRTOS_IP_Timers_utest
FreeRTOS_Stream_Buffer_utest
FreeRTOS_DNS_utest
FreeRTOS_DNS_ConfigNoCallback_utest
FreeRTOS_ND_utest
FreeRTOS_RA_utest
FreeRTOS_TCP_WIN_utest
FreeRTOS_Tiny_TCP_utest
FreeRTOS_TCP_Reception_utest
FreeRTOS_TCP_State_Handling_utest
FreeRTOS_TCP_State_Handling_IPv4_utest
FreeRTOS_TCP_State_Handling_IPv6_utest
FreeRTOS_TCP_Transmission
FreeRTOS_TCP_Transmission_IPv6
FreeRTOS_TCP_IP
FreeRTOS_TCP_Utils
FreeRTOS_TCP_Utils_IPv6_utest
FreeRTOS_Routing_utest
FreeRTOS_Routing_ConfigCompatibleWithSingle_utest
FreeRTOS_Routing_ConfigV4Only_utest
FreeRTOS_Sockets_GenericAPI_utest
FreeRTOS_Sockets_privates_utest
FreeRTOS_Sockets_TCP_API_utest
Expand All @@ -355,15 +355,22 @@ add_custom_target( coverage
FreeRTOS_Sockets_DiffConfig1_TCP_API_utest
FreeRTOS_Sockets_DiffConfig1_UDP_API_utest
FreeRTOS_Sockets_IPv6_utest
FreeRTOS_IPv6_utest
FreeRTOS_IPv6_ConfigDriverCheckChecksum_utest
FreeRTOS_IPv4_utest
FreeRTOS_IPv4_DiffConfig_utest
FreeRTOS_IPv4_DiffConfig1_utest
FreeRTOS_IPv4_Sockets_utest
FreeRTOS_Routing_utest
FreeRTOS_Routing_ConfigV4Only_utest
FreeRTOS_Routing_ConfigCompatibleWithSingle_utest
FreeRTOS_Stream_Buffer_utest
FreeRTOS_TCP_IP_utest
FreeRTOS_TCP_IP_DiffConfig_utest
FreeRTOS_TCP_Reception_utest
FreeRTOS_TCP_State_Handling_utest
FreeRTOS_TCP_State_Handling_IPv4_utest
FreeRTOS_TCP_State_Handling_IPv6_utest
FreeRTOS_TCP_Transmission_utest
FreeRTOS_TCP_Transmission_IPv6_utest
FreeRTOS_TCP_Utils_utest
FreeRTOS_TCP_Utils_IPv6_utest
FreeRTOS_TCP_WIN_utest
FreeRTOS_Tiny_TCP_utest
FreeRTOS_UDP_IP_utest
FreeRTOS_UDP_IPv4_utest
FreeRTOS_UDP_IPv6_utest
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

0 comments on commit 6392cb9

Please sign in to comment.