Use latest version of Snappy instead of 1.1.6. Build Snappy as a static library rather than shared.

This commit is contained in:
Alexey Petrenko 2017-08-24 15:19:09 +03:00 committed by Martin Wicke
parent 3dd53c2c8c
commit fad50ea1ca
2 changed files with 6 additions and 5 deletions

View File

@ -207,7 +207,7 @@ if(tensorflow_ENABLE_JEMALLOC_SUPPORT)
endif() endif()
if(tensorflow_ENABLE_SNAPPY_SUPPORT) if(tensorflow_ENABLE_SNAPPY_SUPPORT)
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})
endif() endif()

View File

@ -15,14 +15,14 @@
include (ExternalProject) include (ExternalProject)
set(snappy_URL https://github.com/google/snappy.git) set(snappy_URL https://github.com/google/snappy.git)
set(snappy_TAG "1.1.6") set(snappy_TAG "55924d11095df25ab25c405fadfe93d0a46f82eb")
set(snappy_BUILD ${CMAKE_CURRENT_BINARY_DIR}/snappy/src/snappy) 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_LIBRARIES ${snappy_BUILD}/$(Configuration)/snappy.lib) set(snappy_STATIC_LIBRARIES ${snappy_BUILD}/$(Configuration)/snappy.lib)
else() else()
set(snappy_LIBRARIES ${snappy_BUILD}/libsnappy.so) set(snappy_STATIC_LIBRARIES ${snappy_BUILD}/libsnappy.a)
endif() endif()
set(snappy_HEADERS set(snappy_HEADERS
@ -42,7 +42,8 @@ ExternalProject_Add(snappy
CMAKE_CACHE_ARGS CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DSNAPPY_BUILD_TESTS:BOOL=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
) )
# actually enables snappy in the source code # actually enables snappy in the source code