You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
libcpp and msan to external projects
This commit is contained in:
@@ -15,6 +15,8 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set(_toolset "intel-linux")
|
||||
endif()
|
||||
|
||||
message("${_toolset} will be used for Boost compilation with compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
|
||||
set(INSTALL_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/.boost/boost-lib)
|
||||
set(BOOST_ROOT "${INSTALL_LOCATION}")
|
||||
set(Boost_INCLUDE_DIRS "${INSTALL_LOCATION}/include")
|
||||
@@ -22,17 +24,18 @@ set(Boost_LIBRARY_DIRS "${INSTALL_LOCATION}/lib")
|
||||
link_directories("${Boost_LIBRARY_DIRS}")
|
||||
|
||||
set(_cxxargs "-fPIC -DBOOST_NO_AUTO_PTR -fvisibility=default")
|
||||
set(_linkflags "")
|
||||
|
||||
if(WITH_MSAN)
|
||||
set(_cxxargs "${_cxxargs} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE")
|
||||
endif()
|
||||
|
||||
if(COLUMNSTORE_WITH_LIBCPP)
|
||||
set(_linkflags "-stdlib=libc++")
|
||||
elseif(COLUMNSTORE_WITH_LIBCPP)
|
||||
set(_cxxargs "${_cxxargs} -stdlib=libc++")
|
||||
set(_linkflags "-stdlib=libc++")
|
||||
endif()
|
||||
|
||||
set(_b2args cxxflags=${_cxxargs};cflags=-fPIC;threading=multi;${_extra};toolset=${_toolset}
|
||||
--without-mpi;--without-charconv;--without-python;--prefix=${INSTALL_LOCATION}
|
||||
--without-mpi;--without-charconv;--without-python;--prefix=${INSTALL_LOCATION} linkflags=${_linkflags}
|
||||
)
|
||||
|
||||
set(byproducts)
|
||||
@@ -57,8 +60,7 @@ ExternalProject_Add(
|
||||
BUILD_COMMAND ./b2 -q ${_b2args}
|
||||
BUILD_IN_SOURCE TRUE
|
||||
INSTALL_COMMAND ./b2 -q install ${_b2args}
|
||||
#LOG_BUILD TRUE
|
||||
#LOG_INSTALL TRUE
|
||||
# LOG_BUILD TRUE LOG_INSTALL TRUE
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
${byproducts}
|
||||
)
|
||||
|
@@ -35,12 +35,13 @@ set(THRIFT_LIBRARY ${THRIFT_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}thrift${
|
||||
|
||||
set(cxxflags -fPIC)
|
||||
|
||||
set(linkflags "")
|
||||
if(WITH_MSAN)
|
||||
set(cxxflags "'${cxxflags} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE -stdlib=libc++'")
|
||||
endif()
|
||||
|
||||
if(COLUMNSTORE_WITH_LIBCPP AND NOT DEFINED WITH_MSAN)
|
||||
set(linkflags "'${linkflags} -stdlib=libc++'")
|
||||
elseif(COLUMNSTORE_WITH_LIBCPP)
|
||||
set(cxxflags "'${cxxflags} -stdlib=libc++'")
|
||||
set(linkflags "'${linkflags} -stdlib=libc++'")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(
|
||||
@@ -64,6 +65,9 @@ ExternalProject_Add(
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_CXX_FLAGS:STRING=${cxxflags}
|
||||
-DBOOST_ROOT=${BOOST_ROOT}
|
||||
-DCMAKE_EXE_LINKER_FLAGS=${linkflags}
|
||||
-DCMAKE_SHARED_LINKER_FLAGS=${linkflags}
|
||||
-DCMAKE_MODULE_LINKER_FLAGS=${linkflags}
|
||||
BUILD_BYPRODUCTS "${THRIFT_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}thrift${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
@@ -9,21 +9,21 @@ if(WITH_UNITTESTS)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external)
|
||||
set(cxxflags "")
|
||||
|
||||
set(linkflags "")
|
||||
if(WITH_MSAN)
|
||||
set(cxxflags "'${cxxflags} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE -stdlib=libc++'")
|
||||
endif()
|
||||
|
||||
if(COLUMNSTORE_WITH_LIBCPP AND NOT DEFINED WITH_MSAN)
|
||||
set(linkflags "'${linkflags} -stdlib=libc++'")
|
||||
elseif(COLUMNSTORE_WITH_LIBCPP)
|
||||
set(cxxflags "'${cxxflags} -stdlib=libc++'")
|
||||
set(linkflags "'${linkflags} -stdlib=libc++'")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest
|
||||
GIT_TAG release-1.12.0
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DBUILD_SHARED_LIBS=ON
|
||||
-DCMAKE_CXX_FLAGS:STRING=${cxxflags}
|
||||
-DCMAKE_CXX_FLAGS:STRING=${cxxflags} -DCMAKE_EXE_LINKER_FLAGS=${linkflags}
|
||||
-DCMAKE_SHARED_LINKER_FLAGS=${linkflags} -DCMAKE_MODULE_LINKER_FLAGS=${linkflags}
|
||||
)
|
||||
|
||||
# this is a workaround for gtest's bug still not closed https://github.com/google/googletest/issues/3659
|
||||
|
Reference in New Issue
Block a user