From dbd5521a697eae275afeb5d8a0b256670238f5b9 Mon Sep 17 00:00:00 2001 From: clonker <1685266+clonker@users.noreply.github.com> Date: Fri, 4 Apr 2025 07:50:21 +0200 Subject: [PATCH 1/4] remove install of obsolete jsoncpp --- .circleci/osx_install_dependencies.sh | 3 --- scripts/install_obsolete_jsoncpp_1_7_4.sh | 24 ----------------------- 2 files changed, 27 deletions(-) delete mode 100755 scripts/install_obsolete_jsoncpp_1_7_4.sh diff --git a/.circleci/osx_install_dependencies.sh b/.circleci/osx_install_dependencies.sh index e7a0b9ddfda2..6e0c859f9ace 100755 --- a/.circleci/osx_install_dependencies.sh +++ b/.circleci/osx_install_dependencies.sh @@ -59,9 +59,6 @@ then brew install openjdk@11 brew install unzip - # writing to /usr/local/lib need administrative privileges. - sudo ./scripts/install_obsolete_jsoncpp_1_7_4.sh - # boost boost_version="1.84.0" boost_package="boost_${boost_version//./_}.tar.bz2" diff --git a/scripts/install_obsolete_jsoncpp_1_7_4.sh b/scripts/install_obsolete_jsoncpp_1_7_4.sh deleted file mode 100755 index f9de0245d70b..000000000000 --- a/scripts/install_obsolete_jsoncpp_1_7_4.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -eu - -TEMPDIR=$(mktemp -d) -( - cd "$TEMPDIR" - jsoncpp_version="1.7.4" - jsoncpp_package="jsoncpp-${jsoncpp_version}.tar.gz" - jsoncpp_sha256=10dcd0677e80727e572a1e462193e51a5fde3e023b99e144b2ee1a469835f769 - wget -O "$jsoncpp_package" https://github.com/open-source-parsers/jsoncpp/archive/${jsoncpp_version}.tar.gz - if ! [ "$(sha256sum "$jsoncpp_package")" = "${jsoncpp_sha256} ${jsoncpp_package}" ] - then - >&2 echo "ERROR: Downloaded jsoncpp source package has wrong checksum." - exit 1 - fi - tar xvzf "$jsoncpp_package" - cd "jsoncpp-${jsoncpp_version}" - mkdir -p build - cd build - cmake -DCMAKE_OSX_ARCHITECTURES:STRING="x86_64;arm64" -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" .. - make - make install -) -rm -r "$TEMPDIR" From f323bd4de27b635dab1ba249832a1ec0b054cf4e Mon Sep 17 00:00:00 2001 From: clonker <1685266+clonker@users.noreply.github.com> Date: Fri, 4 Apr 2025 09:07:12 +0200 Subject: [PATCH 2/4] cmake: use boost include dirs and version in status message --- cmake/EthDependencies.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/EthDependencies.cmake b/cmake/EthDependencies.cmake index 87a5e1b5e17e..56d90bb478e3 100644 --- a/cmake/EthDependencies.cmake +++ b/cmake/EthDependencies.cmake @@ -49,8 +49,7 @@ if (NOT TARGET Boost::boost) # header only target add_library(Boost::boost INTERFACE IMPORTED) set_property(TARGET Boost::boost APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) endif() -get_property(LOCATION TARGET Boost::boost PROPERTY INTERFACE_INCLUDE_DIRECTORIES) -message(STATUS "Found Boost headers in ${LOCATION}") +message(STATUS "Found Boost ${Boost_VERSION} headers in ${Boost_INCLUDE_DIRS}") foreach (BOOST_COMPONENT IN LISTS BOOST_COMPONENTS) if (NOT TARGET Boost::${BOOST_COMPONENT}) From e6d56997aba55b2805a288b671d14651bd140270 Mon Sep 17 00:00:00 2001 From: clonker <1685266+clonker@users.noreply.github.com> Date: Fri, 4 Apr 2025 09:17:23 +0200 Subject: [PATCH 3/4] set CMP0167 to OLD behavior for boost versions < 1.70 --- cmake/EthDependencies.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake/EthDependencies.cmake b/cmake/EthDependencies.cmake index 56d90bb478e3..f79140dd29d9 100644 --- a/cmake/EthDependencies.cmake +++ b/cmake/EthDependencies.cmake @@ -31,6 +31,10 @@ endif() set(BOOST_COMPONENTS "filesystem;unit_test_framework;program_options;system") +# CMake >= 3.30 should not use the vendored boost +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) +endif() if (WIN32) # Boost 1.77 fixes a bug that causes crashes on Windows for some relative paths in --allow-paths. # See https://github.com/boostorg/filesystem/issues/201 @@ -38,7 +42,16 @@ if (WIN32) else() # Boost 1.65 is the first to also provide boost::get for rvalue-references (#5787). # Boost 1.67 moved container_hash into is own module. - find_package(Boost 1.67.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS}) + # Boost 1.70 comes with its own BoostConfig.cmake and is the new (non-deprecated) behavior + find_package(Boost 1.70.0 QUIET COMPONENTS ${BOOST_COMPONENTS}) + if (NOT ${Boost_FOUND}) + # If the boost version is < 1.70.0, there is no boost config delivered with it, revert to old behavior + # todo drop this once cmake minimum version >= 3.30 is reached + if(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) + endif() + find_package(Boost 1.67.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS}) + endif() endif() # If cmake is older than boost and boost is older than 1.70, From 4c23d04b53cba7bfda8ddf19ead131e88529e003 Mon Sep 17 00:00:00 2001 From: clonker <1685266+clonker@users.noreply.github.com> Date: Mon, 7 Apr 2025 16:00:49 +0200 Subject: [PATCH 4/4] Disable pedantic compilation for CMake 4.0.0 and AppleClang 15.0 --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b39878f26d3..29bf2b0ca663 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,14 @@ endif() find_package(Threads) +if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin" AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + if (CMAKE_VERSION VERSION_EQUAL "4.0.0" AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "15.0.0.15000040") + # for Apple clang 15 under cmake 4.0.0, disable pedantic warnings explicitly as it fails to treat boost properly as + # system library, warnings propagate + set(PEDANTIC OFF) + endif() +endif() + if(NOT PEDANTIC) message(WARNING "-- Pedantic build flags turned off. Warnings will not make compilation fail. This is NOT recommended in development builds.") endif()