Skip to content

Commit

Permalink
Add port option through variable
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Jun 24, 2023
1 parent ce5e478 commit 0104c96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ else()
${CMAKE_CURRENT_LIST_DIR}/lwesp/src/apps/http_server/lwesp_http_server_fs_win32.c

# Port specific
${CMAKE_CURRENT_LIST_DIR}/lwesp/src/system/lwesp_sys_win32.c
${CMAKE_CURRENT_LIST_DIR}/lwesp/src/system/lwesp_ll_win32.c
)

Expand All @@ -31,9 +30,6 @@ else()
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/dev
${CMAKE_CURRENT_LIST_DIR}/../lwmem/lwmem/src/include

# Port specifics
${CMAKE_CURRENT_LIST_DIR}/lwesp/src/include/system/port/win32
)

# Compilation definition information
Expand All @@ -52,6 +48,7 @@ else()
)

# Add subdir with lwesp and link to the project
set(LWESP_SYS_PORT "win32")
add_subdirectory(lwesp)
target_link_libraries(${PROJECT_NAME} lwesp)
target_link_libraries(${PROJECT_NAME} lwesp_api)
Expand Down
5 changes: 5 additions & 0 deletions lwesp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ set(lwesp_include_DIRS
${CMAKE_CURRENT_LIST_DIR}/src/include
)

if (DEFINED LWESP_SYS_PORT)
set(lwesp_core_SRCS ${lwesp_core_SRCS} ${CMAKE_CURRENT_LIST_DIR}/src/system/lwesp_sys_${LWESP_SYS_PORT}.c)
set(lwesp_include_DIRS ${lwesp_include_DIRS} ${CMAKE_CURRENT_LIST_DIR}/src/include/system/port/${LWESP_SYS_PORT})
endif()

# Register core library to the system
add_library(lwesp INTERFACE)
target_sources(lwesp PUBLIC ${lwesp_core_SRCS})
Expand Down

0 comments on commit 0104c96

Please sign in to comment.