Skip to content

Commit 637f205

Browse files
cho-mabinavpp
authored andcommitted
Fix build with Boost 1.89.0
Boost.System has been header-only since Boost 1.69 and will be dropping the compatibility stub library in Boost 1.89 (boostorg/system@7a495bb). Since the `system` component is only needed for Boost < 1.69, it can be added to `BOOST_COMPONENTS` in the fallback find_package. Signed-off-by: Michael Cho <[email protected]>
1 parent c33f9da commit 637f205

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

cmake/EthDependencies.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if (WIN32)
2929
option(Boost_USE_STATIC_RUNTIME "Link Boost against static C++ runtime libraries" ON)
3030
endif()
3131

32-
set(BOOST_COMPONENTS "filesystem;unit_test_framework;program_options;system")
32+
set(BOOST_COMPONENTS "filesystem;unit_test_framework;program_options")
3333

3434
# CMake >= 3.30 should not use the vendored boost
3535
if(POLICY CMP0167)
@@ -50,6 +50,7 @@ else()
5050
if(POLICY CMP0167)
5151
cmake_policy(SET CMP0167 OLD)
5252
endif()
53+
list(APPEND BOOST_COMPONENTS system)
5354
find_package(Boost 1.67.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
5455
endif()
5556
endif()

libsolutil/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ set(sources
4747
)
4848

4949
add_library(solutil ${sources})
50-
target_link_libraries(solutil PUBLIC Boost::boost Boost::filesystem Boost::system range-v3 fmt::fmt-header-only nlohmann_json::nlohmann_json)
50+
target_link_libraries(solutil PUBLIC Boost::boost Boost::filesystem ${Boost_SYSTEM_LIBRARY} range-v3 fmt::fmt-header-only nlohmann_json::nlohmann_json)
5151
target_include_directories(solutil PUBLIC "${PROJECT_SOURCE_DIR}")
5252
add_dependencies(solutil solidity_BuildInfo.h)
5353

test/tools/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ add_executable(yulrun yulrun.cpp)
66
target_link_libraries(yulrun PRIVATE yulInterpreter libsolc evmasm Boost::boost Boost::program_options)
77

88
add_executable(solfuzzer afl_fuzzer.cpp fuzzer_common.cpp)
9-
target_link_libraries(solfuzzer PRIVATE libsolc evmasm Boost::boost Boost::program_options Boost::system)
9+
target_link_libraries(solfuzzer PRIVATE libsolc evmasm Boost::boost Boost::program_options ${Boost_SYSTEM_LIBRARY})
1010

1111
add_executable(yulopti yulopti.cpp)
12-
target_link_libraries(yulopti PRIVATE solidity Boost::boost Boost::program_options Boost::system)
12+
target_link_libraries(yulopti PRIVATE solidity Boost::boost Boost::program_options ${Boost_SYSTEM_LIBRARY})
1313

1414
add_executable(isoltest
1515
isoltest.cpp

0 commit comments

Comments
 (0)