You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
chore(build): refactor main CMakeLists.txt (#3543)
* chore(build): refactor main CMakeLists.txt * chore(build): fix boost version for packages, set clang-20 only for amd and arm * chore(build): boost 4 sm * chore(build): boost dep for rowgroup * chore(build): toolset for boost * chore(build): suppress clang warnings for boost * chore(ci, build): use ASAN for unittest on ubuntu 24.04 only, added custom cmake flag option for bootstrap, custom params for new and existing pipelines * chore(build): sort bootstrap flags * chore(CI): remove publish pkg step, adding clickable link instead to publish steps, fix customenv
This commit is contained in:
@ -1,51 +1,56 @@
|
||||
if (Boost_FOUND)
|
||||
add_custom_target(external_boost)
|
||||
return()
|
||||
find_package(Boost 1.84.0 COMPONENTS chrono filesystem program_options regex system thread)
|
||||
|
||||
if(Boost_FOUND)
|
||||
add_custom_target(external_boost)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(_toolset "gcc")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
|
||||
set(_extra "pch=off")
|
||||
endif()
|
||||
set(_toolset "gcc")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
|
||||
set(_extra "pch=off")
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
|
||||
set(_toolset "clang")
|
||||
set(_toolset "clang")
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set(_toolset "intel-linux")
|
||||
set(_toolset "intel-linux")
|
||||
endif()
|
||||
|
||||
set(INSTALL_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/.boost/boost-lib)
|
||||
SET(Boost_INCLUDE_DIRS "${INSTALL_LOCATION}/include")
|
||||
SET(Boost_LIBRARY_DIRS "${INSTALL_LOCATION}/lib")
|
||||
LINK_DIRECTORIES("${Boost_LIBRARY_DIRS}")
|
||||
set(BOOST_ROOT "${INSTALL_LOCATION}")
|
||||
set(Boost_INCLUDE_DIRS "${INSTALL_LOCATION}/include")
|
||||
set(Boost_LIBRARY_DIRS "${INSTALL_LOCATION}/lib")
|
||||
link_directories("${Boost_LIBRARY_DIRS}")
|
||||
|
||||
set(_cxxargs "-fPIC -DBOOST_NO_AUTO_PTR -fvisibility=default")
|
||||
set(_b2args cxxflags=${_cxxargs};cflags=-fPIC;threading=multi;${_extra};toolset=${_toolset} --without-python;--prefix=${INSTALL_LOCATION})
|
||||
|
||||
SET(byproducts)
|
||||
FOREACH(name chrono filesystem program_options regex system thread)
|
||||
SET(lib boost_${name})
|
||||
ADD_LIBRARY(${lib} STATIC IMPORTED GLOBAL)
|
||||
ADD_DEPENDENCIES(${lib} external_boost)
|
||||
SET (loc "${Boost_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
SET(byproducts ${byproducts} BUILD_BYPRODUCTS ${loc})
|
||||
SET_TARGET_PROPERTIES(${lib} PROPERTIES IMPORTED_LOCATION ${loc}
|
||||
EXCLUDE_FROM_ALL TRUE)
|
||||
ENDFOREACH()
|
||||
|
||||
ExternalProject_Add(external_boost
|
||||
PREFIX .boost
|
||||
URL https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.gz
|
||||
URL_HASH SHA256=a5800f405508f5df8114558ca9855d2640a2de8f0445f051fa1c7c3383045724
|
||||
CONFIGURE_COMMAND ./bootstrap.sh
|
||||
UPDATE_COMMAND ""
|
||||
BUILD_COMMAND ./b2 -q ${_b2args}
|
||||
BUILD_IN_SOURCE TRUE
|
||||
INSTALL_COMMAND ./b2 -q install ${_b2args}
|
||||
LOG_BUILD TRUE
|
||||
LOG_INSTALL TRUE
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
${byproducts}
|
||||
set(_b2args cxxflags=${_cxxargs};cflags=-fPIC;threading=multi;${_extra};toolset=${_toolset}
|
||||
--without-python;--prefix=${INSTALL_LOCATION}
|
||||
)
|
||||
|
||||
set(byproducts)
|
||||
foreach(name chrono filesystem program_options regex system thread)
|
||||
set(lib boost_${name})
|
||||
add_library(${lib} STATIC IMPORTED GLOBAL)
|
||||
add_dependencies(${lib} external_boost)
|
||||
set(loc "${Boost_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
set(byproducts ${byproducts} BUILD_BYPRODUCTS ${loc})
|
||||
set_target_properties(${lib} PROPERTIES IMPORTED_LOCATION ${loc} EXCLUDE_FROM_ALL TRUE)
|
||||
endforeach()
|
||||
|
||||
ExternalProject_Add(
|
||||
external_boost
|
||||
PREFIX .boost
|
||||
URL https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.gz
|
||||
URL_HASH SHA256=a5800f405508f5df8114558ca9855d2640a2de8f0445f051fa1c7c3383045724
|
||||
CONFIGURE_COMMAND ./bootstrap.sh
|
||||
UPDATE_COMMAND ""
|
||||
BUILD_COMMAND ./b2 -q ${_b2args}
|
||||
BUILD_IN_SOURCE TRUE
|
||||
INSTALL_COMMAND ./b2 -q install ${_b2args}
|
||||
LOG_BUILD TRUE
|
||||
LOG_INSTALL TRUE
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
${byproducts}
|
||||
)
|
||||
|
Reference in New Issue
Block a user