Commit 0e4dd996 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4845] move xz-4.999.9beta up the tree

git-svn-id: file:///svn/toku/tokudb@44232 c7de825b-a66e-492c-adef-691d508d4ae1
parent 61bcc5b1
...@@ -10,56 +10,7 @@ project(TokuDB) ...@@ -10,56 +10,7 @@ project(TokuDB)
include(TokuFeatureDetection) include(TokuFeatureDetection)
include(TokuSetupCompiler) include(TokuSetupCompiler)
include(TokuSetupCTest) include(TokuSetupCTest)
include(TokuThirdParty)
## add lzma with an external project
include(ExternalProject)
set(xz_configure_opts --with-pic)
if (CMAKE_SYSTEM_NAME MATCHES Darwin)
## lzma has some assembly that doesn't work on osx
list(APPEND xz_configure_opts --disable-assembler)
endif ()
if (CMAKE_BUILD_TYPE MATCHES Release)
if (CMAKE_C_COMPILER_ID MATCHES Intel)
list(APPEND xz_configure_opts CC=icc "CFLAGS=-O2 -g -ip -ipo1" AR=xiar)
endif ()
else ()
list(APPEND xz_configure_opts --enable-debug)
endif ()
if (CMAKE_GENERATOR STREQUAL Ninja)
## ninja doesn't understand "$(MAKE)"
ExternalProject_Add(ep_lzma
PREFIX xz
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xz-4.999.9beta
CONFIGURE_COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/xz-4.999.9beta/configure ${xz_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
BUILD_COMMAND
make -C src/liblzma
INSTALL_COMMAND
make -C src/liblzma install
)
else ()
## use "$(MAKE)" for submakes so they can use the jobserver, doesn't
## seem to break Xcode...
ExternalProject_Add(ep_lzma
PREFIX xz
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xz-4.999.9beta
CONFIGURE_COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/xz-4.999.9beta/configure ${xz_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
BUILD_COMMAND
$(MAKE) -C src/liblzma
INSTALL_COMMAND
$(MAKE) -C src/liblzma install
)
endif ()
add_custom_target(build_lzma DEPENDS ep_lzma)
add_library(lzma STATIC IMPORTED)
set_target_properties(lzma PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/lib/liblzma.a")
## everything needs these libraries ## everything needs these libraries
link_libraries(dl pthread z) link_libraries(dl pthread z)
......
# TODO(leif): will need to be smarter about this when we do trunk/tags/branches
set(TOKU_SVNROOT "${TokuDB_SOURCE_DIR}/../.." CACHE FILEPATH "The top of the tokudb source tree, usod to find xz sources.")
## add lzma with an external project
include(ExternalProject)
set(xz_configure_opts --with-pic)
if (CMAKE_SYSTEM_NAME MATCHES Darwin)
## lzma has some assembly that doesn't work on osx
list(APPEND xz_configure_opts --disable-assembler)
endif ()
if (CMAKE_BUILD_TYPE MATCHES Release)
if (CMAKE_C_COMPILER_ID MATCHES Intel)
list(APPEND xz_configure_opts CC=icc "CFLAGS=-O2 -g -ip -ipo1" AR=xiar)
endif ()
else ()
list(APPEND xz_configure_opts --enable-debug)
endif ()
set(XZ_SOURCE_DIR "${TOKU_SVNROOT}/xz-4.999.9beta")
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 TOKU_SVNROOT.")
endif ()
if (CMAKE_GENERATOR STREQUAL Ninja)
## ninja doesn't understand "$(MAKE)"
ExternalProject_Add(ep_lzma
PREFIX xz
SOURCE_DIR "${XZ_SOURCE_DIR}"
CONFIGURE_COMMAND
"${XZ_SOURCE_DIR}/configure" ${xz_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
BUILD_COMMAND
make -C src/liblzma
INSTALL_COMMAND
make -C src/liblzma install
)
else ()
## use "$(MAKE)" for submakes so they can use the jobserver, doesn't
## seem to break Xcode...
ExternalProject_Add(ep_lzma
PREFIX xz
SOURCE_DIR "${XZ_SOURCE_DIR}"
CONFIGURE_COMMAND
"${XZ_SOURCE_DIR}/configure" ${xz_configure_opts}
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
BUILD_COMMAND
$(MAKE) -C src/liblzma
INSTALL_COMMAND
$(MAKE) -C src/liblzma install
)
endif ()
add_custom_target(build_lzma DEPENDS ep_lzma)
add_library(lzma STATIC IMPORTED)
set_target_properties(lzma PROPERTIES IMPORTED_LOCATION
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/lib/liblzma.a")
# TODO(leif): jemalloc?
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment