mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
00686e6d0e
cmake/jemalloc.cmake: for dependencies to work, LIBJEMALLOC should be the target name, not the path storage/tokudb/CMakeLists.txt: * check the preconditions * disable bdb tests (compilation errors) * set variable, instead of SET_PROPERTY. same effect, but doesn't fail when a plugin is disabled (that is, a target does not exist) storage/tokudb/ft-index/CMakeLists.txt: cmake should not look into examples/ directory, there is hand-crafted examples/Makefile that cmake will overwrite storage/tokudb/ft-index/buildheader/CMakeLists.txt: the syntax is ADD_EXECUTABLE(target source) and "source" is the file name storage/tokudb/ft-index/cmake_modules/TokuMergeLibs.cmake: Libraries must be specified in the specific order, REMOVE_DUPLICATES cannot be used, because it destroys this order. (when OSLIBS contains "-lpthread -ljemalloc -lpthread", REMOVE_DUPLICATES makes it "-lpthread -ljemalloc". But a thread library *must* be *after* jemalloc) storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake: * 'which' might print errors to stderr, they are not important, shut them up * we don't have TOKUDB_DATA, no need to warn about it * don't configure_file into itself (with input=output) storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake: jemalloc is built externally to tokudb/ft-index storage/tokudb/ft-index/ft/CMakeLists.txt: the syntax is ADD_EXECUTABLE(target source) and "source" is the file name storage/tokudb/ft-index/ft/tests/CMakeLists.txt: the syntax is ADD_EXECUTABLE(target source) and "source" is the file name storage/tokudb/ft-index/locktree/tests/CMakeLists.txt: the syntax is ADD_EXECUTABLE(target source) and "source" is the file name storage/tokudb/ft-index/portability/CMakeLists.txt: s/jemalloc/libjemalloc/ storage/tokudb/ft-index/portability/os_malloc.cc: unnecessary include file storage/tokudb/ft-index/portability/tests/CMakeLists.txt: the syntax is ADD_EXECUTABLE(target source) and "source" is the file name storage/tokudb/ft-index/src/tests/CMakeLists.txt: the syntax is ADD_EXECUTABLE(target source) and "source" is the file name storage/tokudb/ft-index/util/tests/CMakeLists.txt: the syntax is ADD_EXECUTABLE(target source) and "source" is the file name storage/tokudb/ft-index/utils/CMakeLists.txt: the syntax is ADD_EXECUTABLE(target source) and "source" is the file name
72 lines
3.2 KiB
CMake
72 lines
3.2 KiB
CMake
include(ExternalProject)
|
|
|
|
## add lzma with an external project
|
|
set(xz_configure_opts --with-pic --enable-static)
|
|
if (APPLE)
|
|
## lzma has some assembly that doesn't work on darwin
|
|
list(APPEND xz_configure_opts --disable-assembler)
|
|
endif ()
|
|
|
|
list(APPEND xz_configure_opts CC=${CMAKE_C_COMPILER})
|
|
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL drd)
|
|
list(APPEND xz_configure_opts --enable-debug)
|
|
endif ()
|
|
|
|
set(XZ_SOURCE_DIR "${TokuDB_SOURCE_DIR}/third_party/xz-4.999.9beta" CACHE FILEPATH "Where to find sources for xz (lzma).")
|
|
if (NOT EXISTS "${XZ_SOURCE_DIR}/configure")
|
|
message(FATAL_ERROR "Can't find the xz sources. Please check them out to ${XZ_SOURCE_DIR} or modify XZ_SOURCE_DIR.")
|
|
endif ()
|
|
|
|
if (CMAKE_GENERATOR STREQUAL Ninja)
|
|
## ninja doesn't understand "$(MAKE)"
|
|
set(SUBMAKE_COMMAND make)
|
|
else ()
|
|
## use "$(MAKE)" for submakes so they can use the jobserver, doesn't
|
|
## seem to break Xcode...
|
|
set(SUBMAKE_COMMAND $(MAKE))
|
|
endif ()
|
|
|
|
FILE(GLOB XZ_ALL_FILES ${XZ_SOURCE_DIR}/*)
|
|
ExternalProject_Add(build_lzma
|
|
PREFIX xz
|
|
DOWNLOAD_COMMAND
|
|
cp -au "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
|
|
CONFIGURE_COMMAND
|
|
"<SOURCE_DIR>/configure" ${xz_configure_opts}
|
|
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
|
|
BUILD_COMMAND
|
|
${SUBMAKE_COMMAND} -C src/liblzma
|
|
INSTALL_COMMAND
|
|
${SUBMAKE_COMMAND} -C src/liblzma install
|
|
)
|
|
FILE(GLOB_RECURSE XZ_ALL_FILES_RECURSIVE ${XZ_SOURCE_DIR}/*)
|
|
ExternalProject_Add_Step(build_lzma reclone_src # Names of project and custom step
|
|
COMMENT "(re)cloning xz source..." # Text printed when step executes
|
|
DEPENDERS download configure # Steps that depend on this step
|
|
DEPENDS ${XZ_ALL_FILES_RECURSIVE} # Files on which this step depends
|
|
)
|
|
|
|
set_source_files_properties(
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/base.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/bcj.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/block.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/check.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/container.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/delta.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/filter.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/index.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/index_hash.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/lzma.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/stream_flags.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/subblock.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/version.h"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include/lzma/vli.h"
|
|
PROPERTIES GENERATED TRUE)
|
|
|
|
include_directories("${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/include")
|
|
|
|
add_library(lzma STATIC IMPORTED)
|
|
set_target_properties(lzma PROPERTIES IMPORTED_LOCATION
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/lib/liblzma.a")
|
|
add_dependencies(lzma build_lzma)
|