Skip to content

Commit

Permalink
fix(modem): Pregenerate includes for easier IDE navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Nov 1, 2024
1 parent 58026d0 commit 20d92f3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/esp_modem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(srcs ${platform_srcs}
"src/esp_modem_dte.cpp"
"src/esp_modem_dce.cpp"
"src/esp_modem_api.cpp"
"src/esp_modem_c_api.cpp"
# "src/esp_modem_c_api.cpp"
"src/esp_modem_factory.cpp"
"src/esp_modem_cmux.cpp"
"src/esp_modem_command_library.cpp"
Expand All @@ -28,10 +28,14 @@ set(srcs ${platform_srcs}
"src/esp_modem_vfs_socket_creator.cpp"
"src/esp_modem_modules.cpp")

set(include_dirs "include")
if(CONFIG_USE_INPLACE_COMMAND_TEMPLATES)
set(include_dirs "include" "include/generate")
else()
set(include_dirs "include" "include/commands")
endif()

idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
INCLUDE_DIRS "include" "include/commands"
PRIV_INCLUDE_DIRS private_include
REQUIRES ${dependencies})

Expand Down
3 changes: 3 additions & 0 deletions components/esp_modem/scripts/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
for i in esp_modem_dce_generic.hpp esp_modem_dce_module.hpp esp_modem_command_library.hpp; do
cat ../include/generate/$i | clang++ -E -P -CC -xc++ -I../include - > ../include/commands/cxx_include/$i
done

0 comments on commit 20d92f3

Please sign in to comment.