Merge pull request #14651 from tchaikov/wip-silent-boost-build

cmake: pass -d0 to b2 if not CMAKE_VERBOSE_MAKEFILE

Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Sage Weil 2017-04-25 16:53:58 -05:00 committed by GitHub
commit 7e2a286446

View File

@ -512,6 +512,12 @@ endif()
# Boost
option(WITH_SYSTEM_BOOST "require and build with system Boost" OFF)
set(BOOST_COMPONENTS
thread system regex random program_options date_time iostreams)
if(WITH_MGR)
list(APPEND BOOST_COMPONENTS python)
endif()
if (WITH_SYSTEM_BOOST)
if(ENABLE_SHARED)
set(Boost_USE_STATIC_LIBS OFF)
@ -527,35 +533,33 @@ else()
set(BOOST_SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/boost")
set(BOOST_PREFIX "${PROJECT_BINARY_DIR}/boost")
set(BOOST_BUILD "${PROJECT_BINARY_DIR}/boost-build")
set(Boost_USE_STATIC_LIBS ON)
string(REPLACE ";" "," BOOST_WITH_LIBS "${BOOST_COMPONENTS}")
execute_process(COMMAND "./bootstrap.sh"
"--prefix=${BOOST_PREFIX}"
"--with-libraries=atomic,container,context,coroutine,coroutine2,date_time,filesystem,iostreams,program_options,python,random,regex,system,thread"
"--with-libraries=${BOOST_WITH_LIBS}"
WORKING_DIRECTORY ${BOOST_SOURCE_DIR})
# 2. install headers
set(BOOST_ROOT "${BOOST_PREFIX}")
execute_process(COMMAND "./b2"
#"--buildid=ceph" # changes lib names--can omit for static
"--variant=release" # could override
"--link=static" # avoid library versioning issues
"--threading=multi"
"--build-dir=${BOOST_BUILD}"
"-j${BOOST_J}"
"cxxflags=${BOOST_CFLAGS}"
"headers"
set(b2 ./b2
--build-dir=${BOOST_BUILD} -j${BOOST_J})
if(CMAKE_VERBOSE_MAKEFILE)
list(APPEND b2 -d1)
else()
list(APPEND b2 -d0)
endif()
list(APPEND b2
variant=release link=static threading=multi cxxflags=${BOOST_CFLAGS})
# 2. install headers
execute_process(COMMAND
${b2}
headers
WORKING_DIRECTORY ${BOOST_SOURCE_DIR})
# 3. build and install libs
execute_process(COMMAND "./b2"
#"--buildid=ceph" # changes lib names--can omit for static
"--variant=release" # could override
"--link=static" # avoid library versioning issues
"--threading=multi"
"--build-dir=${BOOST_BUILD}"
"-j${BOOST_J}"
"cxxflags=${BOOST_CFLAGS}"
"install"
execute_process(COMMAND
${b2}
install
WORKING_DIRECTORY ${BOOST_SOURCE_DIR})
# 4. set hints for FindBoost.cmake
set(Boost_USE_STATIC_LIBS ON)
set(Boost_NO_SYSTEM_PATHS ON)
include_directories(BEFORE ${BOOST_PREFIX}/include)
# fixup for CheckIncludeFileCXX
@ -567,12 +571,6 @@ endif()
set(Boost_USE_MULTITHREADED ON)
set(BOOST_COMPONENTS
thread system regex random program_options date_time iostreams)
if(WITH_MGR)
list(APPEND BOOST_COMPONENTS python)
endif()
# require minimally the bundled version
find_package(Boost 1.61 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})