2019-04-18 17:51:19 +00:00
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
2015-07-01 23:13:49 +00:00
|
|
|
# Edit definitions below to specify paths to include files and libraries of all 3rd party libraries
|
|
|
|
|
2018-01-05 22:52:57 +00:00
|
|
|
# TODO: Make this work with find_package and/or get rid of it
|
2015-07-09 21:42:41 +00:00
|
|
|
#
|
|
|
|
# This example assumes all the libraries locate in directories under THIRDPARTY_HOME environment variable
|
|
|
|
# Set environment variable THIRDPARTY_HOME to point to your third party libraries home (Unix style dir separators)
|
|
|
|
# or change the paths below to reflect where the libraries actually reside
|
|
|
|
#
|
|
|
|
set (THIRDPARTY_LIBS "") # Initialization, don't touch
|
2015-07-07 23:49:47 +00:00
|
|
|
|
2015-07-01 23:13:49 +00:00
|
|
|
#
|
2018-01-05 22:52:57 +00:00
|
|
|
# Defaults
|
2015-07-01 23:13:49 +00:00
|
|
|
#
|
|
|
|
set(GFLAGS_HOME $ENV{THIRDPARTY_HOME}/Gflags.Library)
|
2018-06-04 19:04:52 +00:00
|
|
|
set(GFLAGS_INCLUDE ${GFLAGS_HOME}/build/native/include)
|
|
|
|
set(GFLAGS_LIB_DEBUG ${GFLAGS_HOME}/lib/native/debug/amd64/gflags.lib)
|
|
|
|
set(GFLAGS_LIB_RELEASE ${GFLAGS_HOME}/lib/native/retail/amd64/gflags.lib)
|
2015-07-01 23:13:49 +00:00
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
# ================================================== GFLAGS ==================================================
|
2018-01-05 22:52:57 +00:00
|
|
|
# For compatibility
|
|
|
|
if (GFLAGS)
|
|
|
|
set(WITH_GFLAGS ON)
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-01-05 22:52:57 +00:00
|
|
|
if (WITH_GFLAGS)
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "GFLAGS library is enabled")
|
2015-11-24 19:51:37 +00:00
|
|
|
|
|
|
|
if(DEFINED ENV{GFLAGS_INCLUDE})
|
|
|
|
set(GFLAGS_INCLUDE $ENV{GFLAGS_INCLUDE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{GFLAGS_LIB_DEBUG})
|
|
|
|
set(GFLAGS_LIB_DEBUG $ENV{GFLAGS_LIB_DEBUG})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{GFLAGS_LIB_RELEASE})
|
|
|
|
set(GFLAGS_LIB_RELEASE $ENV{GFLAGS_LIB_RELEASE})
|
|
|
|
endif()
|
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
set(GFLAGS_CXX_FLAGS -DGFLAGS=gflags)
|
|
|
|
set(GFLAGS_LIBS debug ${GFLAGS_LIB_DEBUG} optimized ${GFLAGS_LIB_RELEASE})
|
|
|
|
|
|
|
|
add_definitions(${GFLAGS_CXX_FLAGS})
|
|
|
|
include_directories(${GFLAGS_INCLUDE})
|
|
|
|
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${GFLAGS_LIBS})
|
|
|
|
else ()
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "GFLAGS library is disabled")
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|
2015-07-01 23:13:49 +00:00
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
# ================================================== SNAPPY ==================================================
|
2015-07-01 23:13:49 +00:00
|
|
|
#
|
|
|
|
# Edit these 4 lines to define paths to Snappy
|
|
|
|
#
|
|
|
|
set(SNAPPY_HOME $ENV{THIRDPARTY_HOME}/Snappy.Library)
|
2018-06-04 19:04:52 +00:00
|
|
|
set(SNAPPY_INCLUDE ${SNAPPY_HOME}/build/native/inc/inc)
|
|
|
|
set(SNAPPY_LIB_DEBUG ${SNAPPY_HOME}/lib/native/debug/amd64/snappy.lib)
|
|
|
|
set(SNAPPY_LIB_RELEASE ${SNAPPY_HOME}/lib/native/retail/amd64/snappy.lib)
|
2015-07-01 23:13:49 +00:00
|
|
|
|
2018-01-05 22:52:57 +00:00
|
|
|
# For compatibility
|
|
|
|
if(SNAPPY)
|
|
|
|
set(WITH_SNAPPY ON)
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-01-05 22:52:57 +00:00
|
|
|
if (WITH_SNAPPY)
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "SNAPPY library is enabled")
|
2018-06-04 19:04:52 +00:00
|
|
|
|
2015-11-24 19:51:37 +00:00
|
|
|
if(DEFINED ENV{SNAPPY_INCLUDE})
|
|
|
|
set(SNAPPY_INCLUDE $ENV{SNAPPY_INCLUDE})
|
|
|
|
endif()
|
2018-06-04 19:04:52 +00:00
|
|
|
|
2015-11-24 19:51:37 +00:00
|
|
|
if(DEFINED ENV{SNAPPY_LIB_DEBUG})
|
|
|
|
set(SNAPPY_LIB_DEBUG $ENV{SNAPPY_LIB_DEBUG})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{SNAPPY_LIB_RELEASE})
|
|
|
|
set(SNAPPY_LIB_RELEASE $ENV{SNAPPY_LIB_RELEASE})
|
|
|
|
endif()
|
2018-06-04 19:04:52 +00:00
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
set(SNAPPY_CXX_FLAGS -DSNAPPY)
|
|
|
|
set(SNAPPY_LIBS debug ${SNAPPY_LIB_DEBUG} optimized ${SNAPPY_LIB_RELEASE})
|
|
|
|
|
|
|
|
add_definitions(${SNAPPY_CXX_FLAGS})
|
|
|
|
include_directories(${SNAPPY_INCLUDE})
|
|
|
|
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${SNAPPY_LIBS})
|
|
|
|
else ()
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "SNAPPY library is disabled")
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|
2015-07-01 23:13:49 +00:00
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
# ================================================== LZ4 ==================================================
|
2015-07-01 23:13:49 +00:00
|
|
|
#
|
2015-07-09 21:42:41 +00:00
|
|
|
# Edit these 4 lines to define paths to LZ4
|
2015-07-01 23:13:49 +00:00
|
|
|
#
|
2015-07-09 21:42:41 +00:00
|
|
|
set(LZ4_HOME $ENV{THIRDPARTY_HOME}/LZ4.Library)
|
2018-06-04 19:04:52 +00:00
|
|
|
set(LZ4_INCLUDE ${LZ4_HOME}/build/native/inc/inc)
|
|
|
|
set(LZ4_LIB_DEBUG ${LZ4_HOME}/lib/native/debug/amd64/lz4.lib)
|
|
|
|
set(LZ4_LIB_RELEASE ${LZ4_HOME}/lib/native/retail/amd64/lz4.lib)
|
2015-07-01 23:13:49 +00:00
|
|
|
|
2018-06-04 19:04:52 +00:00
|
|
|
|
|
|
|
# For compatibility
|
|
|
|
if (LZ4)
|
2018-01-05 22:52:57 +00:00
|
|
|
set(WITH_LZ4 ON)
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|
2015-07-07 23:49:47 +00:00
|
|
|
|
2018-01-05 22:52:57 +00:00
|
|
|
if (WITH_LZ4)
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "LZ4 library is enabled")
|
2015-11-24 19:51:37 +00:00
|
|
|
|
|
|
|
if(DEFINED ENV{LZ4_INCLUDE})
|
|
|
|
set(LZ4_INCLUDE $ENV{LZ4_INCLUDE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{LZ4_LIB_DEBUG})
|
|
|
|
set(LZ4_LIB_DEBUG $ENV{LZ4_LIB_DEBUG})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{LZ4_LIB_RELEASE})
|
|
|
|
set(LZ4_LIB_RELEASE $ENV{LZ4_LIB_RELEASE})
|
|
|
|
endif()
|
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
set(LZ4_CXX_FLAGS -DLZ4)
|
|
|
|
set(LZ4_LIBS debug ${LZ4_LIB_DEBUG} optimized ${LZ4_LIB_RELEASE})
|
2015-07-07 23:49:47 +00:00
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
add_definitions(${LZ4_CXX_FLAGS})
|
|
|
|
include_directories(${LZ4_INCLUDE})
|
|
|
|
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${LZ4_LIBS})
|
|
|
|
else ()
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "LZ4 library is disabled")
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|
2015-07-07 23:49:47 +00:00
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
# ================================================== ZLIB ==================================================
|
|
|
|
#
|
|
|
|
# Edit these 4 lines to define paths to ZLIB
|
|
|
|
#
|
|
|
|
set(ZLIB_HOME $ENV{THIRDPARTY_HOME}/ZLIB.Library)
|
2018-06-04 19:04:52 +00:00
|
|
|
set(ZLIB_INCLUDE ${ZLIB_HOME}/build/native/inc/inc)
|
|
|
|
set(ZLIB_LIB_DEBUG ${ZLIB_HOME}/lib/native/debug/amd64/zlib.lib)
|
|
|
|
set(ZLIB_LIB_RELEASE ${ZLIB_HOME}/lib/native/retail/amd64/zlib.lib)
|
2018-01-05 22:52:57 +00:00
|
|
|
|
|
|
|
# For compatibilty
|
|
|
|
if (ZLIB)
|
|
|
|
set(WITH_ZLIB ON)
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|
2015-07-07 23:49:47 +00:00
|
|
|
|
2018-01-05 22:52:57 +00:00
|
|
|
if (WITH_ZLIB)
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "ZLIB library is enabled")
|
2015-11-24 19:51:37 +00:00
|
|
|
|
|
|
|
if(DEFINED ENV{ZLIB_INCLUDE})
|
|
|
|
set(ZLIB_INCLUDE $ENV{ZLIB_INCLUDE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{ZLIB_LIB_DEBUG})
|
|
|
|
set(ZLIB_LIB_DEBUG $ENV{ZLIB_LIB_DEBUG})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{ZLIB_LIB_RELEASE})
|
|
|
|
set(ZLIB_LIB_RELEASE $ENV{ZLIB_LIB_RELEASE})
|
|
|
|
endif()
|
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
set(ZLIB_CXX_FLAGS -DZLIB)
|
|
|
|
set(ZLIB_LIBS debug ${ZLIB_LIB_DEBUG} optimized ${ZLIB_LIB_RELEASE})
|
|
|
|
|
|
|
|
add_definitions(${ZLIB_CXX_FLAGS})
|
|
|
|
include_directories(${ZLIB_INCLUDE})
|
|
|
|
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${ZLIB_LIBS})
|
|
|
|
else ()
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "ZLIB library is disabled")
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-06-04 19:04:52 +00:00
|
|
|
# ================================================== XPRESS ==================================================
|
|
|
|
# This makes use of built-in Windows API, no additional includes, links to a system lib
|
|
|
|
|
2018-01-05 22:52:57 +00:00
|
|
|
# For compatibilty
|
|
|
|
if (XPRESS)
|
|
|
|
set(WITH_XPRESS ON)
|
2016-04-20 05:54:24 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-01-05 22:52:57 +00:00
|
|
|
if (WITH_XPRESS)
|
2016-04-20 05:54:24 +00:00
|
|
|
message(STATUS "XPRESS is enabled")
|
|
|
|
|
|
|
|
add_definitions(-DXPRESS)
|
|
|
|
|
|
|
|
# We are using the implementation provided by the system
|
|
|
|
set (SYSTEM_LIBS ${SYSTEM_LIBS} Cabinet.lib)
|
|
|
|
else ()
|
|
|
|
message(STATUS "XPRESS is disabled")
|
|
|
|
endif ()
|
|
|
|
|
2018-06-04 19:04:52 +00:00
|
|
|
|
|
|
|
# ================================================== ZSTD ==================================================
|
2015-07-09 21:42:41 +00:00
|
|
|
#
|
2018-06-04 19:04:52 +00:00
|
|
|
# Edit these 4 lines to define paths to ZSTD
|
2015-07-09 21:42:41 +00:00
|
|
|
#
|
2018-06-04 19:04:52 +00:00
|
|
|
set(ZSTD_HOME $ENV{THIRDPARTY_HOME}/ZSTD.Library)
|
|
|
|
set(ZSTD_INCLUDE ${ZSTD_HOME}/build/native/inc)
|
|
|
|
set(ZSTD_LIB_DEBUG ${ZSTD_HOME}/lib/native/debug/amd64/libzstd_static.lib)
|
|
|
|
set(ZSTD_LIB_RELEASE ${ZSTD_HOME}/lib/native/retail/amd64/libzstd_static.lib)
|
|
|
|
|
|
|
|
# For compatibility
|
|
|
|
if (ZSTD)
|
|
|
|
set(WITH_ZSTD ON)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (WITH_ZSTD)
|
|
|
|
message(STATUS "ZSTD library is enabled")
|
|
|
|
|
|
|
|
if(DEFINED ENV{ZSTD_INCLUDE})
|
|
|
|
set(ZSTD_INCLUDE $ENV{ZSTD_INCLUDE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{ZSTD_LIB_DEBUG})
|
|
|
|
set(ZSTD_LIB_DEBUG $ENV{ZSTD_LIB_DEBUG})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{ZSTD_LIB_RELEASE})
|
|
|
|
set(ZSTD_LIB_RELEASE $ENV{ZSTD_LIB_RELEASE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# ZSTD_STATIC_LINKING_ONLY only allows us to create an allocation functions override
|
|
|
|
# When jemalloc is in use
|
|
|
|
set(ZSTD_LIBS debug ${ZSTD_LIB_DEBUG} optimized ${ZSTD_LIB_RELEASE})
|
|
|
|
|
|
|
|
add_definitions(-DZSTD -DZSTD_STATIC_LINKING_ONLY)
|
|
|
|
include_directories(${ZSTD_INCLUDE})
|
|
|
|
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${ZSTD_LIBS})
|
|
|
|
else ()
|
|
|
|
message(STATUS "ZSTD library is disabled")
|
|
|
|
endif ()
|
2015-07-09 21:42:41 +00:00
|
|
|
|
|
|
|
#
|
2018-06-04 19:04:52 +00:00
|
|
|
# Edit these 4 lines to define paths to Jemalloc
|
2015-07-09 21:42:41 +00:00
|
|
|
#
|
2018-06-04 19:04:52 +00:00
|
|
|
set(JEMALLOC_HOME $ENV{THIRDPARTY_HOME}/Jemalloc.Library)
|
|
|
|
set(JEMALLOC_INCLUDE ${JEMALLOC_HOME}/build/native/inc)
|
|
|
|
set(JEMALLOC_LIB_DEBUG ${JEMALLOC_HOME}/lib/native/debug/amd64/jemalloc.lib)
|
|
|
|
set(JEMALLOC_LIB_RELEASE ${JEMALLOC_HOME}/lib/native/retail/amd64/jemalloc.lib)
|
2015-07-07 23:49:47 +00:00
|
|
|
|
2018-06-04 19:04:52 +00:00
|
|
|
# ================================================== JEMALLOC ==================================================
|
2017-10-27 20:14:07 +00:00
|
|
|
if(JEMALLOC)
|
|
|
|
set(WITH_JEMALLOC ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WITH_JEMALLOC)
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "JEMALLOC library is enabled")
|
2019-06-25 00:36:26 +00:00
|
|
|
set(JEMALLOC_CXX_FLAGS "-DROCKSDB_JEMALLOC -DJEMALLOC_EXPORT= -DJEMALLOC_NO_RENAME")
|
2015-11-24 19:51:37 +00:00
|
|
|
|
|
|
|
if(DEFINED ENV{JEMALLOC_INCLUDE})
|
|
|
|
set(JEMALLOC_INCLUDE $ENV{JEMALLOC_INCLUDE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{JEMALLOC_LIB_DEBUG})
|
|
|
|
set(JEMALLOC_LIB_DEBUG $ENV{JEMALLOC_LIB_DEBUG})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{JEMALLOC_LIB_RELEASE})
|
|
|
|
set(JEMALLOC_LIB_RELEASE $ENV{JEMALLOC_LIB_RELEASE})
|
|
|
|
endif()
|
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
set(JEMALLOC_LIBS debug ${JEMALLOC_LIB_DEBUG} optimized ${JEMALLOC_LIB_RELEASE})
|
|
|
|
|
|
|
|
add_definitions(${JEMALLOC_CXX_FLAGS})
|
|
|
|
include_directories(${JEMALLOC_INCLUDE})
|
|
|
|
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${JEMALLOC_LIBS})
|
|
|
|
set (ARTIFACT_SUFFIX "_je")
|
2018-06-04 19:04:52 +00:00
|
|
|
|
2015-07-09 21:42:41 +00:00
|
|
|
else ()
|
|
|
|
set (ARTIFACT_SUFFIX "")
|
2015-09-30 18:20:23 +00:00
|
|
|
message(STATUS "JEMALLOC library is disabled")
|
2015-07-09 21:42:41 +00:00
|
|
|
endif ()
|