diff --git a/build/bootstrap_mcs.sh b/build/bootstrap_mcs.sh index 1b33670f2..309559507 100755 --- a/build/bootstrap_mcs.sh +++ b/build/bootstrap_mcs.sh @@ -400,7 +400,7 @@ construct_cmake_flags() { if [[ $MSAN = true ]]; then warn "Building with Memory Sanitizer" - MDB_CMAKE_FLAGS+=(-DWITH_MSAN=ON -DWITH_COLUMNSTORE_REPORT_PATH=${REPORT_PATH}) + MDB_CMAKE_FLAGS+=(-DWITH_MSAN=ON -DCOLUMNSTORE_WITH_LIBCPP=YES -DWITH_COLUMNSTORE_REPORT_PATH=${REPORT_PATH}) fi if [[ $WITHOUT_COREDUMPS = true ]]; then @@ -800,6 +800,7 @@ init_submodules if [[ $BUILD_PACKAGES = true ]]; then modify_packaging fix_config_files + (build_package && run_unit_tests) exit_code=$? diff --git a/cmake/boost.cmake b/cmake/boost.cmake index d454ff9b5..19d1fc464 100644 --- a/cmake/boost.cmake +++ b/cmake/boost.cmake @@ -22,8 +22,13 @@ set(Boost_LIBRARY_DIRS "${INSTALL_LOCATION}/lib") link_directories("${Boost_LIBRARY_DIRS}") set(_cxxargs "-fPIC -DBOOST_NO_AUTO_PTR -fvisibility=default") + if(WITH_MSAN) - set(_cxxargs "${_cxxargs} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE -stdlib=libc++") + set(_cxxargs "${_cxxargs} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE") +endif() + +if(COLUMNSTORE_WITH_LIBCPP) + set(_cxxargs "${_cxxargs} -stdlib=libc++") endif() set(_b2args cxxflags=${_cxxargs};cflags=-fPIC;threading=multi;${_extra};toolset=${_toolset} diff --git a/cmake/thrift.cmake b/cmake/thrift.cmake index 7ead4c71f..454bd0d7b 100644 --- a/cmake/thrift.cmake +++ b/cmake/thrift.cmake @@ -33,9 +33,14 @@ set(THRIFT_INCLUDE_DIRS "${INSTALL_LOCATION}/include") set(THRIFT_LIBRARY_DIRS "${INSTALL_LOCATION}/lib") set(THRIFT_LIBRARY ${THRIFT_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}thrift${CMAKE_STATIC_LIBRARY_SUFFIX}) -set(cxxflags -fPIC) +set(cxxflags "-fPIC") + if(WITH_MSAN) - set(cxxflags "'${cxxflags} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE -stdlib=libc++'") + set(cxxflags "${cxxflags} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE") +endif() + +if(COLUMNSTORE_WITH_LIBCPP) + set(cxxflags "${cxxflags} -stdlib=libc++") endif() ExternalProject_Add( @@ -57,7 +62,7 @@ ExternalProject_Add( -DBUILD_TUTORIALS=NO -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_CXX_FLAGS:STRING=${cxxflags} + -DCMAKE_CXX_FLAGS:STRING="'${cxxflags}'" -DBOOST_ROOT=${BOOST_ROOT} BUILD_BYPRODUCTS "${THRIFT_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}thrift${CMAKE_STATIC_LIBRARY_SUFFIX}" EXCLUDE_FROM_ALL TRUE