Przeglądaj źródła

add: 关闭ble的情况下,依然可以编译成功

Wendal Chen 3 lat temu
rodzic
commit
85aa6c55d6

+ 5 - 3
luatos/components/luat/CMakeLists.txt

@@ -1,10 +1,13 @@
 
-
+set(srcs "port")
+if(CONFIG_BT_ENABLED)
+    list(APPEND srcs "ble" "${LUATOS_ROOT}/components/nimble/src")
+endif()
 
 idf_component_register(SRC_DIRS ${LUATOS_ROOT}/luat/modules
                                 ${LUATOS_ROOT}/luat/vfs
                                 ${LUATOS_ROOT}/lua/src
-                                port
+                                ${srcs}
                                 ${LUATOS_ROOT}/components/shell
                                 ${LUATOS_ROOT}/components/ymodem
                                 ${LUATOS_ROOT}/components/cmux
@@ -61,7 +64,6 @@ idf_component_register(SRC_DIRS ${LUATOS_ROOT}/luat/modules
                                 ${LUATOS_ROOT}/components/lora
                                 ${LUATOS_ROOT}/components/lora/sx126x
                                 ${LUATOS_ROOT}/components/network/httpsrv/src
-                                ${LUATOS_ROOT}/components/nimble/src
                     EXCLUDE_SRCS
                                 ${LUATOS_ROOT}/luat/modules/luat_lib_http.c
                     INCLUDE_DIRS ../../include

+ 0 - 0
luatos/components/luat/port/luat_nimble_idf5.c → luatos/components/luat/ble/luat_nimble_idf5.c


+ 2 - 3
luatos/components/luat/port/luat_base_idf5.c

@@ -141,9 +141,6 @@ static const luaL_Reg loadedlibs[] = {
 #ifdef LUAT_USE_GTFONT
   {"gtfont",    luaopen_gtfont},
 #endif
-#ifdef LUAT_USE_NIMBLE
-  {"nimble",    luaopen_nimble},
-#endif
 #ifdef LUAT_USE_FDB
   {"fdb",       luaopen_fdb},
 #endif
@@ -192,7 +189,9 @@ static const luaL_Reg loadedlibs[] = {
   {"httpsrv", luaopen_httpsrv},
 #endif
 #ifdef LUAT_USE_NIMBLE
+#if CONFIG_BT_ENABLED
   {"nimble", luaopen_nimble},
+#endif
 #endif
   {NULL, NULL}
 };