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

Create a modular CMake configuration #205

Merged
merged 6 commits into from
Feb 2, 2025

Conversation

qdeslandes
Copy link
Contributor

Modify the configuration generator to allow parts of the project to be disabled. This will simplify the packaging of bpfilter as it will reduce the number of dependencies required to only build and test the project.

By default, the whole project is configured, but some of it can be disabled using -DNO_XXX=1.

Additionally:

  • Create a new integration target to build both iptables and nftables
  • Drop the dependency on jq by filtering the compile_commands.json file using a custom Python script
  • Generate the parser and the lexer manually so make check can depend on them, instead of depending on the bfcli target

Add configuration options to disable creation of extra binaries: tests,
checks, benchmark... Those options are controlled by -DNO_XXX=1.

The dependencies required by each target are discovered from the
CMakeLists.txt file defining the target itself, so disabling part of the
project will ensure the dependencies for this part are not fetched.
Create an `integration` target to build both iptables and nftables.
Define custom command to generate the parser and the lexer used by bfcli
so `make check` can depends on the output of those commands, instead of
depending on `make bfcli`.
The CI build step runs on all of the supported distributions. However,
the benchmark currently doesn't support Fedora 39
(bpf_prog_get_info_by_fd() doesn't exists there). This change disable
the benchmark build for the build step of the CI (the benchmark will run
for Fedora 41 anyway).
@qdeslandes qdeslandes merged commit 4ccaa6a into facebook:main Feb 2, 2025
27 checks passed
@qdeslandes qdeslandes deleted the modular_cmake branch February 2, 2025 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants