Skip to content

Commit 2c86bb0

Browse files
committed
Merge bitcoin/bitcoin#29878: depends: build expat with CMake
a517029 depends: switch to building expat with CMake (fanquake) Pull request description: Switch to building Expat with CMake, instead of Autotools. ACKs for top commit: hebasto: re-ACK a517029. Tree-SHA512: ca040545dd83fb81a8b209aa24cae6e22eaeff04f44bdabc4454adf6ea63d34f4ae27bd5980c65db2d2542e23eb2712102719023c262ab63a933c90b5999c11e
2 parents 7cc00bf + a517029 commit 2c86bb0

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

depends/packages/expat.mk

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,25 @@ $(package)_version=2.4.8
33
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/
44
$(package)_file_name=$(package)-$($(package)_version).tar.xz
55
$(package)_sha256_hash=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25
6+
$(package)_build_subdir=build
7+
$(package)_patches += cmake_minimum.patch
68

79
# -D_DEFAULT_SOURCE defines __USE_MISC, which exposes additional
810
# definitions in endian.h, which are required for a working
911
# endianness check in configure when building with -flto.
1012
define $(package)_set_vars
11-
$(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples
12-
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
13-
$(package)_config_opts += --without-xmlwf
13+
$(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DEXPAT_BUILD_TOOLS=OFF
14+
$(package)_config_opts += -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF
15+
$(package)_config_opts += -DBUILD_SHARED_LIBS=OFF
1416
$(package)_cppflags += -D_DEFAULT_SOURCE
1517
endef
1618

19+
define $(package)_preprocess_cmds
20+
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch
21+
endef
22+
1723
define $(package)_config_cmds
18-
$($(package)_autoconf)
24+
$($(package)_cmake) -S .. -B .
1925
endef
2026

2127
define $(package)_build_cmds
@@ -27,5 +33,5 @@ define $(package)_stage_cmds
2733
endef
2834

2935
define $(package)_postprocess_cmds
30-
rm -rf share lib/cmake lib/*.la
36+
rm -rf share lib/cmake
3137
endef
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
build: set minimum required CMake to 3.16
2+
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -33,7 +33,7 @@
6+
# Unlike most of Expat,
7+
# this file is copyrighted under the BSD-license for buildsystem files of KDE.
8+
9+
-cmake_minimum_required(VERSION 3.1.3)
10+
+cmake_minimum_required(VERSION 3.16)
11+
12+
# This allows controlling documented build time switches
13+
# when Expat is pulled in using the add_subdirectory function, e.g.

0 commit comments

Comments
 (0)