Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to prevent the entire project from being recompiled due to modifying CMakeLists.txt (IDFGH-13903) #14744

Open
3 tasks done
UradaSources opened this issue Oct 17, 2024 · 1 comment
Assignees
Labels
Status: Opened Issue is new

Comments

@UradaSources
Copy link

UradaSources commented Oct 17, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I want to use a library as an idf component but it doesn't come with its own cmake file for idf. There are some cross board files in the library, which I don't need, but I'm not sure which ones I don't need. I can only keep modifying the idf_component_register.SRCS parameters to test, which is a terrible experience. Every time I add even one file to my SOURCE_FILES, it will cause the entire project of more than 1400 source files to be recompiled. I have never hated c++ so much. Is there any way to solve this problem? I also use arduino-esp32 as my component. Maybe there is a way to pre-compile some things as static libraries to reduce compilation time?

set(SOURCE_FILES
    "src/Arduino_DataBus.cpp"
    ...)

idf_component_register(
    INCLUDE_DIRS "src"
    SRCS ${SOURCE_FILES}
    PRIV_REQUIRES "arduino"
)
@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 17, 2024
@github-actions github-actions bot changed the title How to prevent the entire project from being recompiled due to modifying CMakeLists.txt How to prevent the entire project from being recompiled due to modifying CMakeLists.txt (IDFGH-13903) Oct 17, 2024
@dobairoland
Copy link
Collaborator

dobairoland commented Oct 18, 2024

Hi @UradaSources. If I understood your situation correctly then in this case the best and easiest option would be to make sure that you are bulding with ccache enabled. That means it will re-use the previously built source files from the cache if it hasn't been modified.

Depending on your OS and ESP-IDF version, it might be disabled by default. You can force it with the ``--ccache` command line argument:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-py.html#global-options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

3 participants