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 pcap in compile step #141

Merged
merged 3 commits into from Jun 7, 2022
Merged

Compile pcap in compile step #141

merged 3 commits into from Jun 7, 2022

Conversation

aloisklink
Copy link
Contributor

@aloisklink aloisklink commented May 24, 2022

We use FetchContent_MakeAvailable(libpcap) to compile libpcap at compile time.

Additionally, we only compile pcap_static, and nothing else.

Since this is a static library, we also don't need to include it in cmake --install.

Before Merging

This may cause merge conflicts with #137

After reviewing, switch this branch to https://github.com/nqminds/EDGESec/tree/compile-pcap-in-compile-step-fix-merge-conflict, where I've already fixed the merge conflicts.

Previously, the toolchain was being built in the CMAKE_BINARY_DIR.
However, libpcap uses the command, `check_include_file()`, which
creates a new CMake project in a temporary folder to test C/C++ features.

This causes the OpenWRT SDK to be constantly downloaded multiple times,
taking a lot of time.

Instead, I've changed the OpenWRT toolchain file to download and extract
the SDK next to the toolchain file. This should let the SDK be cached.
Manually setting LIBPCAP_INCLUDE_PATH is not needed,
as target_link_libraries(... PCAP::pcap) will automatically
include it when needed.
We use `FetchContent_MakeAvailable(libpcap)` to compile
libpcap at compile time.

Additionally, we only compile `pcap_static`, and nothing else.
Since this is a static library, we also don't need to include
it in `cmake --install`.
@aloisklink aloisklink added the dependencies Pull requests that update a dependency file label May 24, 2022
@aloisklink aloisklink requested a review from mereacre May 24, 2022 16:02
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 ad09654 into main Jun 7, 2022
@aloisklink aloisklink deleted the compile-pcap-in-compile-step branch June 7, 2022 20:32
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants