Skip to content

Commit 60e7cb1

Browse files
authored
Merge pull request ceph#62899 from tchaikov/cmake-build-boost
cmake: Fix b2 build with postfixed compiler versions Reviewed-by: Matan Breizman <[email protected]>
2 parents ded62df + 98b61ac commit 60e7cb1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cmake/modules/BuildBoost.cmake

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,15 @@ function(do_build_boost root_dir version)
9393
message(SEND_ERROR "unknown compiler: ${CMAKE_CXX_COMPILER_ID}")
9494
endif()
9595

96-
# build b2 and prepare the project-config.jam for boost
96+
# prepare the project-config.jam for boost
97+
set(bjam <SOURCE_DIR>/b2)
9798
set(configure_command
9899
./bootstrap.sh --prefix=<INSTALL_DIR>
99100
--with-libraries=${boost_with_libs}
100-
--with-toolset=${toolset})
101+
--with-toolset=${toolset}
102+
--with-bjam=${bjam})
101103

102-
set(b2 ./b2)
104+
set(b2 ${bjam})
103105
if(BOOST_J)
104106
message(STATUS "BUILDING Boost Libraries at j ${BOOST_J}")
105107
list(APPEND b2 -j${BOOST_J})
@@ -183,6 +185,13 @@ function(do_build_boost root_dir version)
183185
BUILD_BYPRODUCTS ${Boost_LIBRARIES}
184186
INSTALL_COMMAND ${install_command}
185187
PREFIX "${root_dir}")
188+
ExternalProject_Add_Step(Boost build-bjam
189+
COMMAND ./tools/build/src/engine/build.sh --cxx=${CMAKE_CXX_COMPILER} ${toolset}
190+
COMMAND ${CMAKE_COMMAND} -E copy ./tools/build/src/engine/b2 ${bjam}
191+
DEPENDEES download
192+
DEPENDERS configure
193+
COMMENT "Building B2 engine.."
194+
WORKING_DIRECTORY <SOURCE_DIR>)
186195
endfunction()
187196

188197
set(Boost_context_DEPENDENCIES thread chrono system date_time)

0 commit comments

Comments
 (0)