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

Compile libnetlink at compile time #136

Merged
merged 4 commits into from Jun 7, 2022

Conversation

aloisklink
Copy link
Contributor

Previously, we compiled libnetlink using a cmake child process during the configure step.

Now, we instead compile libnetlink during the cmake build process using the original cmake executable.

This will make compiling faster, as the cmake configure step is single-processed, while cmake --build can use multiple processes.

To make this easier, I've set it up so that libnetlink is always compiled as a STATIC library, as it's only ever used by the src/utils/nl.c file.

This simplifies a lot of the code.

When running `make install` with `-DBUILD_CMOCKA_LIB=ON`,
prevent cmocka from being installed into the lib/ and include/
folders.
There's no point in making these dynamic, as they're only
used by one source file (src/utils/nl.c)
Previously, we compiled libnetlink using a cmake child process
during the configure step.

Now, we instead compile libnetlink during the cmake build process
using the original cmake executable.

This simplifies a lot of the code.
@aloisklink aloisklink added refactor Refactoring code dependencies Pull requests that update a dependency file labels May 23, 2022
@aloisklink aloisklink requested a review from mereacre May 23, 2022 18:07
Copy link
Contributor

@mereacre mereacre left a comment

Choose a reason for hiding this comment

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

Great.

@mereacre mereacre merged commit bb716fc into main Jun 7, 2022
@aloisklink aloisklink deleted the compile-dependencies-in-build-step branch June 7, 2022 20:31
@aloisklink aloisklink mentioned this pull request Jun 10, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants