Skip to content

Commit 9858d45

Browse files
committed
build all freertos, not able to build net lwip due to lack of sio_open()
1 parent 11e1aff commit 9858d45

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

examples/device/cdc_msc_freertos/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ endif()
1717

1818
add_executable(${PROJECT})
1919

20-
set(freertos_path ${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/FreeRTOS-Kernel)
21-
2220
# Example source
2321
target_sources(${PROJECT} PUBLIC
2422
${CMAKE_CURRENT_SOURCE_DIR}/src/freertos_hook.c
@@ -30,15 +28,16 @@ target_sources(${PROJECT} PUBLIC
3028
# Example include
3129
target_include_directories(${PROJECT} PUBLIC
3230
${CMAKE_CURRENT_SOURCE_DIR}/src
33-
${freertos_path}/include
3431
)
3532

3633
# Configure compilation flags and libraries for the example... see the corresponding function
3734
# in hw/bsp/FAMILY/family.cmake for details.
3835
family_configure_device_example(${PROJECT})
3936

37+
if (NOT TARGET freertos_kernel)
4038
family_add_freertos_config(${PROJECT})
4139
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/FreeRTOS-Kernel lib/FreeRTOS-Kernel)
40+
endif()
4241

4342
target_link_libraries(${PROJECT} PUBLIC
4443
freertos_kernel
Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
44

55
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
66
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
77

8-
project(${PROJECT})
8+
project(${PROJECT} C CXX ASM)
99

1010
# Checks this example is valid for the family and initializes the project
1111
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
1212

13-
# Check for -DFAMILY=
14-
if(NOT FAMILY STREQUAL "espressif")
15-
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
13+
# Espressif has its own cmake build system
14+
if(FAMILY STREQUAL "espressif")
15+
return()
1616
endif()
17+
18+
add_executable(${PROJECT})
19+
20+
# Example source
21+
target_sources(${PROJECT} PUBLIC
22+
${CMAKE_CURRENT_SOURCE_DIR}/src/freertos_hook.c
23+
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
24+
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
25+
)
26+
27+
# Example include
28+
target_include_directories(${PROJECT} PUBLIC
29+
${CMAKE_CURRENT_SOURCE_DIR}/src
30+
)
31+
32+
# Configure compilation flags and libraries for the example... see the corresponding function
33+
# in hw/bsp/FAMILY/family.cmake for details.
34+
family_configure_device_example(${PROJECT})
35+
36+
if (NOT TARGET freertos_kernel)
37+
family_add_freertos_config(${PROJECT})
38+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/FreeRTOS-Kernel lib/FreeRTOS-Kernel)
39+
endif()
40+
41+
target_link_libraries(${PROJECT} PUBLIC
42+
freertos_kernel
43+
)

examples/device/net_lwip_webserver/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

33
set(TOP "../../..")
44
get_filename_component(TOP "${TOP}" REALPATH)
@@ -9,7 +9,7 @@ if (EXISTS ${TOP}/lib/lwip/src)
99
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
1010
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
1111

12-
project(${PROJECT})
12+
project(${PROJECT} C CXX ASM)
1313

1414
# Checks this example is valid for the family and initializes the project
1515
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})

0 commit comments

Comments
 (0)