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

Improve build time when updating Boost flags #1944

Merged
merged 3 commits into from
Dec 27, 2024
Merged

Conversation

varunagrawal
Copy link
Collaborator

I came across an interesting article that gives recommendations on how to set preprocessor flags such that it improves build time.

The key idea is to get rid of add_definitions calls in CMake since it passes the preprocessor flag to all cpp files, and instead use a definition within the config.h.in file. This would then only require re-compiling files that include gtsam/config.h and not the complete project in the event the flags were updated.

Since we already have the config.h.in, this was an easy update.

I recommend reading the article, since it also discusses the benefits of using #cmakedefine01 over #cmakedefine.

@varunagrawal varunagrawal self-assigned this Dec 23, 2024
@varunagrawal varunagrawal changed the title Improve Build Time Improve build time when updating Boost flags Dec 23, 2024
@dellaert
Copy link
Member

LGTM but maybe get review from @jlblancoc ? ROS interactions?

@jlblancoc
Copy link
Member

Hi,
I totally agree with this change, @varunagrawal !!

My only comment is: wouldn't the #ifdef XX need to be #if XXX if using #cmakedefine01 ? (didn't test myself)

@varunagrawal
Copy link
Collaborator Author

@jlblancoc great catch! I'll update it.

Copy link
Member

@jlblancoc jlblancoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, it LGTM!

@varunagrawal varunagrawal merged commit 39d92cb into develop Dec 27, 2024
33 checks passed
@varunagrawal varunagrawal deleted the boost-flags branch December 27, 2024 15:41
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.

3 participants