Skip to content

Commit

Permalink
build: remove LIB_MAKEFLAGS references
Browse files Browse the repository at this point in the history
LIB_MAKEFLAGS was used to pass makeflags to
libraries that were being compiled at configure time.

As of #150 being merged, all libraries are now compiled at
compile time, so this variable is no longer needed.
  • Loading branch information
aloisklink committed Jun 10, 2022
1 parent 14360e5 commit aba44f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 37 deletions.
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ endif ()

option(USE_ZYMKEY4_HSM "Use the Zymkey4 HSM" OFF)

# CMake hides $ENV{MAKEFLAGS}, so we need to define it ourselves
set(LIB_MAKEFLAGS "--jobs=2" CACHE STRING "Flags to pass to make for building libraries (e.g. -j12)")
if(LIB_MAKEFLAGS OR TRUE)
# set makeflags so that OpenSSL can build in parallel
# Prefix with LIB_*, so it only applies when we use
# MAKEFLAGS="$LIB_MAKEFLAGS" in our compile_*.sh scripts
set(ENV{LIB_MAKEFLAGS} "${LIB_MAKEFLAGS}")
endif()

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
Expand Down
4 changes: 0 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Debug"
},
"LIB_MAKEFLAGS": {
"type": "STRING",
"value": "-j$(shell nproc)"
}
}
},
Expand Down
14 changes: 1 addition & 13 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@
%:
dh $@

# Add --jobs=x/ parallel flag to MAKEFLAGS
# This is used both in the build step,
# but we additionally pass it to cmake configure using
# -DLIB_MAKEFLAGS, so that dependent libs (e.g. OpenSSL)
# are compiled with parallel jobs,
# as cmake configure ignores the MAKEFLAGS variable
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += --jobs=$(NUMJOBS)
endif

override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_TARGET_MULTIARCH)" \
Expand All @@ -31,8 +20,7 @@ override_dh_auto_configure:
-DBUILD_NL_LIB=ON\
-DUSE_NETLINK_SERVICE=ON\
-DUSE_UCI_SERVICE=OFF\
-DBUILD_HOSTAPD=ON\
"-DLIB_MAKEFLAGS=--jobs=$(NUMJOBS)"
-DBUILD_HOSTAPD=ON

# make sure to tell dh_shlibdeps about our private shared libs
override_dh_shlibdeps:
Expand Down
14 changes: 3 additions & 11 deletions docs/docusaurus/docs/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,10 @@ Configure `cmake` in the `build/` directory by running the following:

```bash
# or for old versions of cmake, do: mkdir build/ && cd build/ && cmake ..
cmake -S . -B build -DLIB_MAKEFLAGS="--jobs=$(nproc)"
cmake -S . -B build
```

The configure stage will download and compile most of the EDGESec dependencies,
so this may take a while.

Setting `-DLIB_MAKEFLAGS="--jobs=$(nproc)"` will mean that while compiling library dependencies,
`make` commands will run using all CPU cores, greatly speeding this building (set a lower number if you have less RAM).

```bash
cmake -S . -B build -DLIB_MAKEFLAGS="--jobs=$(nproc)"
```
The configure stage will download some of the EDGESec dependencies, so this may take a while.

### Building

Expand Down Expand Up @@ -85,7 +77,7 @@ cmake --install build/
Set `-DCMAKE_INSTALL_PREFIX=<YOUR-LOCATION-HERE>` to build for a different location:

```bash
MAKEFLAGS="--jobs=$(nproc)" cmake -B build/ -S . -DCMAKE_INSTALL_PREFIX=/tmp/example-build
cmake -B build/ -S . -DCMAKE_INSTALL_PREFIX=/tmp/example-build
cmake --build build/ --target install -j4
```

Expand Down

0 comments on commit aba44f8

Please sign in to comment.