xref: /FreeRTOS-Plus-TCP-v4.0.0/test/build-combination/CMakeLists.txt (revision df5aed9e58a72e2489b6c1936788885672c62981)
1add_library( freertos_plus_tcp_config_common INTERFACE )
2target_include_directories(freertos_plus_tcp_config_common INTERFACE Common )
3
4# -------------------------------------------------------------------
5add_library( freertos_plus_tcp_config_all_disable INTERFACE)
6target_include_directories(freertos_plus_tcp_config_all_disable INTERFACE AllDisable)
7target_link_libraries(freertos_plus_tcp_config_all_disable INTERFACE freertos_plus_tcp_config_common)
8
9# -------------------------------------------------------------------
10add_library( freertos_plus_tcp_config_all_enable INTERFACE)
11target_include_directories(freertos_plus_tcp_config_all_enable INTERFACE AllEnable)
12target_link_libraries(freertos_plus_tcp_config_all_enable INTERFACE freertos_plus_tcp_config_common)
13
14# -------------------------------------------------------------------
15add_library( freertos_plus_tcp_config_all_enable_ipv4 INTERFACE)
16target_include_directories(freertos_plus_tcp_config_all_enable_ipv4 INTERFACE Enable_IPv4)
17target_link_libraries(freertos_plus_tcp_config_all_enable_ipv4 INTERFACE freertos_plus_tcp_config_common)
18
19# -------------------------------------------------------------------
20add_library( freertos_plus_tcp_config_all_enable_ipv6 INTERFACE)
21target_include_directories(freertos_plus_tcp_config_all_enable_ipv6 INTERFACE Enable_IPv6)
22target_link_libraries(freertos_plus_tcp_config_all_enable_ipv6 INTERFACE freertos_plus_tcp_config_common)
23
24# -------------------------------------------------------------------
25add_library( freertos_plus_tcp_config_all_enable_ipv4_ipv6 INTERFACE)
26target_include_directories(freertos_plus_tcp_config_all_enable_ipv4_ipv6 INTERFACE Enable_IPv4_IPv6)
27target_link_libraries(freertos_plus_tcp_config_all_enable_ipv4_ipv6 INTERFACE freertos_plus_tcp_config_common)
28
29# -------------------------------------------------------------------
30add_library( freertos_plus_tcp_config_all_enable_ipv4_tcp INTERFACE)
31target_include_directories(freertos_plus_tcp_config_all_enable_ipv4_tcp INTERFACE Enable_IPv4_TCP)
32target_link_libraries(freertos_plus_tcp_config_all_enable_ipv4_tcp INTERFACE freertos_plus_tcp_config_common)
33
34# -------------------------------------------------------------------
35add_library( freertos_plus_tcp_config_all_enable_ipv6_tcp INTERFACE)
36target_include_directories(freertos_plus_tcp_config_all_enable_ipv6_tcp INTERFACE Enable_IPv6_TCP)
37target_link_libraries(freertos_plus_tcp_config_all_enable_ipv6_tcp INTERFACE freertos_plus_tcp_config_common)
38
39# -------------------------------------------------------------------
40add_library( freertos_plus_tcp_config_header_self_contain INTERFACE)
41target_include_directories(freertos_plus_tcp_config_header_self_contain INTERFACE Header_Self_Contain)
42target_link_libraries(freertos_plus_tcp_config_header_self_contain INTERFACE freertos_plus_tcp_config_common)
43
44# -------------------------------------------------------------------
45add_library( freertos_plus_tcp_config_default INTERFACE)
46target_include_directories(freertos_plus_tcp_config_default INTERFACE DefaultConf)
47target_link_libraries(freertos_plus_tcp_config_default INTERFACE freertos_plus_tcp_config_common)
48
49# -------------------------------------------------------------------
50# Configuration for FreeRTOS-Kernel
51if(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "CUSTOM" )
52    # Check Config target is available. And then do nothing.
53    if(NOT TARGET freertos_config )
54        message(FATAL_ERROR "FREERTOS_PLUS_TCP_TEST_CONFIGURATION = CUSTOM, but no freertos_config target defined.")
55    endif()
56elseif(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "DISABLE_ALL" )
57    add_library( freertos_config ALIAS freertos_plus_tcp_config_all_disable)
58elseif(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "ENABLE_ALL" )
59    add_library( freertos_config ALIAS freertos_plus_tcp_config_all_enable)
60elseif(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "ENABLE_ALL_IPV4" )
61    add_library( freertos_config ALIAS freertos_plus_tcp_config_all_enable_ipv4)
62elseif(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "ENABLE_ALL_IPV6" )
63    add_library( freertos_config ALIAS freertos_plus_tcp_config_all_enable_ipv6)
64elseif(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "ENABLE_ALL_IPV4_TCP" )
65    add_library( freertos_config ALIAS freertos_plus_tcp_config_all_enable_ipv4_tcp)
66elseif(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "ENABLE_ALL_IPV6_TCP" )
67    add_library( freertos_config ALIAS freertos_plus_tcp_config_all_enable_ipv6_tcp)
68elseif(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "ENABLE_ALL_IPV4_IPV6" )
69    add_library( freertos_config ALIAS freertos_plus_tcp_config_all_enable_ipv4_ipv6)
70elseif(FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "HEADER_SELF_CONTAIN" )
71    add_library( freertos_config ALIAS freertos_plus_tcp_config_header_self_contain)
72    include( Header_Self_Contain/headerSelfContain.cmake )
73else()
74    add_library( freertos_config ALIAS freertos_plus_tcp_config_default)
75endif()
76
77# Common build combination test.
78add_executable(freertos_plus_tcp_build_test EXCLUDE_FROM_ALL)
79
80target_sources(freertos_plus_tcp_build_test
81PRIVATE
82    Common/main.c
83)
84
85target_compile_options(freertos_plus_tcp_build_test
86    PRIVATE
87    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-qual>
88    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-format-nonliteral>
89    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-implicit-function-declaration>
90    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-noreturn>
91    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-prototypes>
92    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-missing-variable-declarations>
93    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-reserved-identifier>
94    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-shorten-64-to-32>
95    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-sign-conversion>
96    $<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wno-unused-parameter>
97    $<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-unused-macros>
98    $<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wno-unused-variable>
99)
100
101target_link_libraries(freertos_plus_tcp_build_test
102    PRIVATE
103    freertos_plus_tcp
104    freertos_kernel
105)
106