Skip to content

Commit

Permalink
build(openwrt): use single toolchain location
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aloisklink committed May 24, 2022
1 parent c527013 commit 49e3000
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeModules/CMakeToolchains/.gitignore
@@ -0,0 +1,2 @@
# ignore toolchains downloaded by FetchContent
/build
3 changes: 3 additions & 0 deletions CMakeModules/CMakeToolchains/openwrt-mvebu-cortexa9.cmake
Expand Up @@ -16,6 +16,9 @@ if(NOT DEFINED openwrt_toolchain_location)
URL https://downloads.openwrt.org/releases/19.07.10/targets/mvebu/cortexa9/openwrt-sdk-19.07.10-mvebu-cortexa9_gcc-7.5.0_musl_eabi.Linux-x86_64.tar.xz
# sha256 from https://downloads.openwrt.org/releases/19.07.10/targets/mvebu/cortexa9/sha256sums
URL_HASH SHA256=17941f42e26d3c54a836f9897e78abaafcf66e5f0b28ffd8956378aa69c3a4d9
# Make sure that that the toolchain location is indepent from CMAKE_BINARY_DIR/CMAKE_SOURCE_DIR
# otherwise `check_include_file()` commands will redownload these files slowly
PREFIX "${CMAKE_CURRENT_LIST_DIR}/build/openwrt_sdk_mvebu_cortexa9"
)
FetchContent_Populate(openwrt_sdk_mvebu_cortexa9)
set(
Expand Down

0 comments on commit 49e3000

Please sign in to comment.