Enabled SNAPPY in CMake by default, added Linux support
This commit is contained in:
parent
b40716f792
commit
3dd53c2c8c
@ -33,7 +33,7 @@ option(tensorflow_BUILD_MORE_PYTHON_TESTS "Build more python unit tests for cont
|
|||||||
option(tensorflow_BUILD_SHARED_LIB "Build TensorFlow as a shared library" OFF)
|
option(tensorflow_BUILD_SHARED_LIB "Build TensorFlow as a shared library" OFF)
|
||||||
option(tensorflow_OPTIMIZE_FOR_NATIVE_ARCH "Enable compiler optimizations for the native processor architecture (if available)" ON)
|
option(tensorflow_OPTIMIZE_FOR_NATIVE_ARCH "Enable compiler optimizations for the native processor architecture (if available)" ON)
|
||||||
option(tensorflow_WIN_CPU_SIMD_OPTIONS "Enables CPU SIMD instructions")
|
option(tensorflow_WIN_CPU_SIMD_OPTIONS "Enables CPU SIMD instructions")
|
||||||
option(tensorflow_ENABLE_SNAPPY_SUPPORT "Enable SNAPPY compression support" OFF)
|
option(tensorflow_ENABLE_SNAPPY_SUPPORT "Enable SNAPPY compression support" ON)
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
# Threads: defines CMAKE_THREAD_LIBS_INIT and adds -pthread compile option
|
# Threads: defines CMAKE_THREAD_LIBS_INIT and adds -pthread compile option
|
||||||
@ -206,14 +206,10 @@ if(tensorflow_ENABLE_JEMALLOC_SUPPORT)
|
|||||||
include_directories(${jemalloc_INCLUDE_DIRS})
|
include_directories(${jemalloc_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
if(tensorflow_ENABLE_SNAPPY_SUPPORT)
|
if(tensorflow_ENABLE_SNAPPY_SUPPORT)
|
||||||
if (WIN32)
|
include(snappy)
|
||||||
include(snappy)
|
list(APPEND tensorflow_EXTERNAL_LIBRARIES ${snappy_LIBRARIES})
|
||||||
list(APPEND tensorflow_EXTERNAL_LIBRARIES ${snappy_STATIC_LIBRARIES})
|
list(APPEND tensorflow_EXTERNAL_DEPENDENCIES snappy)
|
||||||
list(APPEND tensorflow_EXTERNAL_DEPENDENCIES snappy)
|
include_directories(${snappy_INCLUDE_DIR})
|
||||||
include_directories(${snappy_INCLUDE_DIR})
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "CMake build with SNAPPY is only supported on Windows at the moment")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND tensorflow_EXTERNAL_LIBRARIES wsock32 ws2_32 shlwapi)
|
list(APPEND tensorflow_EXTERNAL_LIBRARIES wsock32 ws2_32 shlwapi)
|
||||||
|
@ -20,7 +20,9 @@ set(snappy_BUILD ${CMAKE_CURRENT_BINARY_DIR}/snappy/src/snappy)
|
|||||||
set(snappy_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/snappy/src/snappy)
|
set(snappy_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/snappy/src/snappy)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(snappy_STATIC_LIBRARIES ${snappy_BUILD}/$(Configuration)/snappy.lib)
|
set(snappy_LIBRARIES ${snappy_BUILD}/$(Configuration)/snappy.lib)
|
||||||
|
else()
|
||||||
|
set(snappy_LIBRARIES ${snappy_BUILD}/libsnappy.so)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(snappy_HEADERS
|
set(snappy_HEADERS
|
||||||
|
Loading…
Reference in New Issue
Block a user