Skip to content

Commit

Permalink
cmake: build success on esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
zebin-wu committed Dec 21, 2023
1 parent fc6c06d commit 348de60
Show file tree
Hide file tree
Showing 78 changed files with 798 additions and 1,130 deletions.
1 change: 0 additions & 1 deletion .github/workflows/esp-idf-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ jobs:

- name: ESP-IDF build
run: |
cd platform/esp
. $IDF_PATH/export.sh
idf.py build
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.vscode
/build
/managed_components
sdkconfig
dependencies.lock
27 changes: 8 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ if(${ESP_PLATFORM})
set(PLATFORM esp)

# Default target is "esp32"
if(NOT DEFINED ${IDF_TARGET})
if(NOT DEFINED IDF_TARGET)
message("IDF_TARGET undefined, set to default target: esp32")
set(IDF_TARGET "esp32")
endif()

Expand All @@ -26,10 +27,15 @@ endif()

# project name
project("homekit-bridge"
LANGUAGES C
LANGUAGES C CXX
VERSION 0.1
)

if(NOT DEFINED PLATFORM)
string(TOLOWER ${CMAKE_SYSTEM_NAME} PLATFORM)
endif()
message("Current platform: " ${PLATFORM})

set(TARGET ${CMAKE_PROJECT_NAME})

# Create a dummy file to work around CMake requirement of
Expand All @@ -42,11 +48,6 @@ add_custom_target(dummy_c_file DEPENDS ${dummy_c_file})
add_executable(${TARGET} ${dummy_c_file})
add_dependencies(${TARGET} dummy_c_file)

if(NOT DEFINED PLATFORM)
string(TOLOWER ${CMAKE_SYSTEM_NAME} PLATFORM)
endif()
message("Current platform: " ${PLATFORM})

include(platform/${PLATFORM}/cmake/platform.cmake)

add_subdirectory(platform)
Expand All @@ -60,15 +61,3 @@ target_link_libraries(${TARGET}
third_party::lua
third_party::lua-cjson
)

if(CONFIG_POSIX)
target_link_libraries(${TARGET} platform::posix)
endif()

if(CONFIG_OPENSSL)
target_link_libraries(${TARGET} platform::openssl)
endif()

if(CONFIG_MBEDTLS)
target_link_libraries(${TARGET} platform::mbedtls)
endif()
124 changes: 0 additions & 124 deletions cmake/adk.cmake

This file was deleted.

28 changes: 0 additions & 28 deletions cmake/argtable3.cmake

This file was deleted.

39 changes: 0 additions & 39 deletions cmake/bridge.cmake

This file was deleted.

16 changes: 0 additions & 16 deletions cmake/lua-cjson.cmake

This file was deleted.

78 changes: 0 additions & 78 deletions cmake/lua.cmake

This file was deleted.

Loading

0 comments on commit 348de60

Please sign in to comment.