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

Allow user-defined Makefile to optimize compiling #355

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

jgfoster
Copy link
Member

@jgfoster jgfoster commented Jul 18, 2023

Our project has about 100 application source files and 50 test files. When I repeatedly run the tests (with no changes) on my local machine they take about 3-1/2 minutes. About half of that time is spent determining what files to compile and what include directories to use and the other half of that time is spent doing the compiling (one file at a time).

When (re)building a large project programmers typically use a tool like make to keep track of dependencies and avoid recompiling files that have not changed. Of course, there is a cost to maintaining the Makefile but it is typically worth it.

With this change we allow the user to provide a Makefile that considerably shortens the process (my project takes 10 seconds to rerun all tests if there are no changes; 15 seconds if there is a change to one test file; and 25 seconds if there is a change to an application file).

If the user does not provide a Makefile then the prior behavior is preserved. Note that this is disabled on Windows (I don't know enough about the build environment; does it support g++?).

@jgfoster
Copy link
Member Author

jgfoster commented Jan 1, 2024

@ian, We've been using this for a number of months based on my fork and I'd like to pull it into here so we can return to using this upstream project. Other than adding a test for the new behavior, the substance of the change is at lib/arduino_ci/cpp_library.rb:543-548. Let me know if you have any concerns; if not, I'll go ahead and merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant