Host/Configure/Default supplies the bootstrap "--" separator before
CMAKE_HOST_OPTIONS. Keep BUILD_TESTING with the CMake cache options so
it is passed after that separator, without introducing a second one.
Fixes: ddb23f3a02 ("tools/cmake: pass -DBUILD_TESTING=OFF to bootstrap")
Signed-off-by: Robert Marko <robimarko@gmail.com>
Instead of carrying 100-no-testing.patch, pass -DBUILD_TESTING=OFF
directly to CMake's bootstrap script. This avoids refreshing the patch
on every CMake update.
The patch also changed the default in the installed CTest.cmake module.
Preserve that behavior by passing -DBUILD_TESTING=OFF by default in
cmake.mk for target and host builds. Packages can override it via
CMAKE_OPTIONS or CMAKE_HOST_OPTIONS.
OpenWrt never runs CMake tests, so building them only wastes build time.
This replaces the patch introduced in 8af80e79bd ("tools/cmake:
update to 3.17.0").
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24403
Signed-off-by: Robert Marko <robimarko@gmail.com>
Instead of carrying a patch (150-zstd-libarchive.patch) that modifies
Utilities/cmlibarchive/CMakeLists.txt to enable pkg-config search for
zstd, pass explicit staging library and include paths (-DZSTD_INCLUDE_DIR
and -DZSTD_LIBRARY) directly to CMake's bootstrap script.
ZSTD_INCLUDE_DIR and ZSTD_LIBRARY are the cache variables CMake itself
sets when --system-zstd is not used, so pre-seeding them guarantees that
CMake always links against OpenWrt's staging libzstd without requiring
a patch.
Fixes: 0e3d51ccae ("tools/cmake: fix compilation with host libzstd-dev")
Suggested-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24407
Signed-off-by: Robert Marko <robimarko@gmail.com>
Upstream commit a9a592f96e6498da302f8e968be1db0ad3c32123
("cmake: Add debugger") added a huge amount of code
in order to create a debugging feature for CMakeLists.txt
of other projects. This was added to CMake since 3.27.x.
Unforunately, this new debugger will not build on ARM systems
like arm-linux-gnueabihf (Raspberry Pi 4), and takes up
extra build time for something Openwrt doesn't need,
yet it was enabled by default. (Thanks Microsoft....)
Specifically, it's a failure to link to functions like
__atomic_store_8, __atomic_load_8, __atomic_fetch_add_8, etc.
Let's just disable it.
Someone who really needs this for developing can have CMake
with the debugger on their host machine or manually re-enable it here.
Link: https://gitlab.kitware.com/cmake/cmake/-/issues/21510
Link: https://devblogs.microsoft.com/cppblog/cmake-debugger-allows-you-to-debug-your-cmake-scripts-and-more/
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Saves a little bit of time when compiling cmake.
Added patches to fix searching liblzma and zlib. The issue is that
because pkgconfig is not used, the system libraries get used.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Use a make variable pattern for the url
so that only one version number needs to be changed
when version is bumped.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Makes sure that Ninja from staging_dir is used and nowhere else.
Reported by reproducible builds project. Builds have been failing ever
since tools/cmake started using Ninja.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Compile with Ninja. Ninja compiles faster and is more stable with
parallel builds. Routines copied from cmake.mk.
Speed improves from:
Executed in 127.47 secs fish external
usr time 17.02 mins 446.00 micros 17.02 mins
sys time 1.18 mins 40.00 micros 1.18 mins
to:
Executed in 118.91 secs fish external
usr time 17.28 mins 499.00 micros 17.28 mins
sys time 1.13 mins 45.00 micros 1.13 mins
Signed-off-by: Rosen Penev <rosenp@gmail.com>
cmake is a dependency of ccache, which means it is build before ccache
is available and hence must be build with non-ccache CC and CXX. It
currently works, because the cmake build system splits the compiler
variable and treats them as multiple compilers to check.
For "ccache gcc" it first tests for "ccache", which always fails,
because ccache is not a compiler by itself, even if it is available, and
then ends up calling "gcc" alone, effectively never using ccache.
Let's make this explicit by forcing the use of non-ccache CC and CXX.
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>