Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions blocks/boost/install/build_jobs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,15 @@ function(BII_BOOST_BUILD_LIBS_PARALLEL LIBS B2_CALL VERBOSE BOOST_DIR)
foreach(lib ${LIBS})
message("Starting ${lib} library build job...")

execute(${B2_CALL} --with-${lib} WORKING_DIRECTORY ${BOOST_DIR}
--success-callback __execute_success_handler
--error-callback __job_error_handler
--async)
if(CMAKE_CROSSCOMPILING)
# workaround: `execute' calls PowerShell when cross compiling from linux for windows
execute_process(COMMAND ${B2_CALL} --with-${lib} WORKING_DIRECTORY ${BOOST_DIR})
else()
execute(${B2_CALL} --with-${lib} WORKING_DIRECTORY ${BOOST_DIR}
--success-callback __execute_success_handler
--error-callback __job_error_handler
--async)
endif()

ans(handle)
set(handles_list ${handles_list} ${handle})
Expand Down
15 changes: 14 additions & 1 deletion blocks/boost/install/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,20 @@ function(__BII_BOOST_INSTALL)

set(__BII_BOOST_B2_CALL ${__BII_BOOST_B2_CALL} cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" ${SCOPE})
endif()


if(CMAKE_CROSSCOMPILING)
BII_BOOST_COMPUTE_TOOLSET_NAME(BII_BOOST_TOOLSET_NAME)
file(WRITE ${BII_BOOST_DIR}/user-config.jam "using ${BII_BOOST_TOOLSET_NAME} : : ${CMAKE_CXX_COMPILER} : <rc>${CMAKE_RC_COMPILER} <archiver>${CMAKE_AR} <ranlib>${CMAKE_RANLIB} ;")

set(__BII_BOOST_B2_CALL ${__BII_BOOST_B2_CALL} --user-config=${BII_BOOST_DIR}/user-config.jam ${SCOPE})

if (WIN32)
set(__BII_BOOST_B2_CALL ${__BII_BOOST_B2_CALL} target-os=windows threadapi=win32 ${SCOPE})
else()
message(FATAL_ERROR "Target not supported for cross compiling. Stopping Boost installation")
endif()
endif()

#Boost

#FindBoost directories
Expand Down
6 changes: 5 additions & 1 deletion blocks/boost/install/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function(COMPILER_VERSION _ret)
set(${_ret} ${__version} PARENT_SCOPE)
endfunction()

function(BII_BOOST_COMPUTE_TOOLSET _ret)
function(BII_BOOST_COMPUTE_TOOLSET_NAME _ret)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel"
OR CMAKE_CXX_COMPILER MATCHES "icl"
OR CMAKE_CXX_COMPILER MATCHES "icpc")
Expand All @@ -60,7 +60,11 @@ function(BII_BOOST_COMPUTE_TOOLSET _ret)
else()
message(FATAL_ERROR "Unknown compiler, unable to compute toolset")
endif()
set(${_ret} ${__toolset_name} PARENT_SCOPE)
endfunction()

function(BII_BOOST_COMPUTE_TOOLSET _ret)
BII_BOOST_COMPUTE_TOOLSET_NAME(__toolset_name)
COMPILER_VERSION(__version)

if(__version AND (NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin")))
Expand Down