Skip to content

Commit

Permalink
Merge #78: cmake: Backport dropping ALLOW_HOST_PACKAGES support
Browse files Browse the repository at this point in the history
b965507 fixup! ci: Test CMake edge cases (Hennadii Stepanov)
fb5023d fixup! cmake: Add cross-compiling support (Hennadii Stepanov)
84f94a8 fixup! build: Generate `share/toolchain.cmake` in depends (Hennadii Stepanov)

Pull request description:

  This PR mirrors changes from bitcoin#29203.

ACKs for top commit:
  TheCharlatan:
    ACK b965507

Tree-SHA512: edeea1943825032c64c95452d7e7b2662bb63dfabb1a35cdbf32136112822b07fc0fb558db942c0d53c0bf3ffaf1cb480169cabd028e3311b0aa9420ccc6e4d4
  • Loading branch information
hebasto committed Jan 18, 2024
2 parents ea9b319 + b965507 commit 42c0d4f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
ubuntu-focal-native:
name: 'Ubuntu 20.04, CMake 3.16, Boost from depends'
name: 'Ubuntu 20.04, CMake 3.16, downloaded Boost'
runs-on: ubuntu-20.04

steps:
Expand All @@ -201,10 +201,10 @@ jobs:
cmake --version
ctest --version
- name: Build Boost in depends
working-directory: depends
- name: Download Boost
run: |
make -j $(nproc) NO_LIBEVENT=1 NO_QT=1 NO_WALLET=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 ALLOW_HOST_PACKAGES=1 CC=gcc-10 CXX=g++-10
curl --location --remote-name https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.gz
tar -xf boost_1_84_0.tar.gz
- name: Restore Ccache cache
uses: actions/cache/restore@v3
Expand All @@ -216,7 +216,7 @@ jobs:

- name: Generate build system
run: |
cmake -B build -DCMAKE_TOOLCHAIN_FILE=depends/x86_64-pc-linux-gnu/share/toolchain.cmake -DENABLE_WALLET=ON -DWITH_NATPMP=ON -DWITH_MINIUPNPC=ON -DWITH_ZMQ=ON -DWITH_USDT=ON -DWERROR=ON
cmake -B build -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 -DBoost_INCLUDE_DIR="${PWD}/boost_1_84_0" -DENABLE_WALLET=ON -DWITH_MINIUPNPC=ON -DWITH_NATPMP=ON -DWITH_ZMQ=ON -DWITH_USDT=ON -DWERROR=ON
- name: Build
working-directory: build
Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ if(CMAKE_CROSSCOMPILING)
target_compile_definitions(core_interface INTERFACE ${DEPENDS_COMPILE_DEFINITIONS})
target_compile_options(core_interface INTERFACE "$<$<COMPILE_LANGUAGE:C>:${DEPENDS_C_COMPILER_FLAGS}>")
target_compile_options(core_interface INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:${DEPENDS_CXX_COMPILER_FLAGS}>")
if(DEPENDS_ALLOW_HOST_PACKAGES)
list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_SYSTEM_PREFIX_PATH}")
endif()
endif()

include(AddThreadsIfNeeded)
Expand Down
1 change: 0 additions & 1 deletion depends/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ $(host_prefix)/share/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
-e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
-e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
-e 's|@no_qt@|$(NO_QT)|' \
-e 's|@no_qr@|$(NO_QR)|' \
-e 's|@no_zmq@|$(NO_ZMQ)|' \
Expand Down
7 changes: 1 addition & 6 deletions depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(PKG_CONFIG_PATH "@depends_prefix@/lib/pkgconfig")
if("@allow_host_packages@" STREQUAL "1")
set(DEPENDS_ALLOW_HOST_PACKAGES TRUE)
else()
set(DEPENDS_ALLOW_HOST_PACKAGES FALSE)
set(PKG_CONFIG_LIBDIR "${PKG_CONFIG_PATH}")
endif()
set(PKG_CONFIG_LIBDIR "${PKG_CONFIG_PATH}")
set(QT_TRANSLATIONS_DIR "@depends_prefix@/translations")

if(NOT WITH_GUI AND "@no_qt@" STREQUAL "1")
Expand Down

0 comments on commit 42c0d4f

Please sign in to comment.