@@ -25,13 +25,20 @@ set(ETH_SCRIPTS_DIR ${ETH_CMAKE_DIR}/scripts)
25
25
## use multithreaded boost libraries, with -mt suffix
26
26
set (Boost_USE_MULTITHREADED ON )
27
27
option (Boost_USE_STATIC_LIBS "Link Boost statically" ON )
28
- if (WIN32 )
28
+ if (WIN32 )
29
29
option (Boost_USE_STATIC_RUNTIME "Link Boost against static C++ runtime libraries" ON )
30
30
endif ()
31
31
32
32
set (BOOST_COMPONENTS "filesystem;unit_test_framework;program_options;system" )
33
33
34
- find_package (Boost 1.65.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
34
+ if (WIN32 )
35
+ # Boost 1.77 fixes a bug that causes crashes on Windows for some relative paths in --allow-paths.
36
+ # See https://github.com/boostorg/filesystem/issues/201
37
+ find_package (Boost 1.77.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
38
+ else ()
39
+ # Boost 1.65 is the first to also provide boost::get for rvalue-references (#5787).
40
+ find_package (Boost 1.65.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
41
+ endif ()
35
42
36
43
# If cmake is older than boost and boost is older than 1.70,
37
44
# find_package does not define imported targets, so we have to
@@ -51,7 +58,7 @@ foreach (BOOST_COMPONENT IN LISTS BOOST_COMPONENTS)
51
58
set_property (TARGET Boost::${BOOST_COMPONENT} PROPERTY IMPORTED_LOCATION ${Boost_${BOOST_COMPONENT_UPPER}_LIBRARY} )
52
59
set_property (TARGET Boost::${BOOST_COMPONENT} PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_${BOOST_COMPONENT_UPPER}_LIBRARIES} )
53
60
set_property (TARGET Boost::${BOOST_COMPONENT} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS} )
54
- endif ()
61
+ endif ()
55
62
get_property (LOCATION TARGET Boost::${BOOST_COMPONENT} PROPERTY IMPORTED_LOCATION )
56
63
message (STATUS "Found Boost::${BOOST_COMPONENT} at ${LOCATION} " )
57
64
endforeach ()
0 commit comments