Commit 29fb51a6 authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Add find module for Snappy

Summary:
Add a find_package module for Snappy
Closes https://github.com/facebook/folly/pull/783

Reviewed By: simpkins

Differential Revision: D7079554

Pulled By: yfeldblum

fbshipit-source-id: bf5dc3f3c37367f43fcbf8b40aaa3bb0a030bee5
parent 0ac0f114
# Find the Snappy libraries
#
# This module defines:
# SNAPPY_FOUND
# SNAPPY_INCLUDE_DIR
# SNAPPY_LIBRARY
find_path(SNAPPY_INCLUDE_DIR NAMES snappy.h)
find_library(SNAPPY_LIBRARY NAMES snappy)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
SNAPPY DEFAULT_MSG
SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR
)
mark_as_advanced(SNAPPY_INCLUDE_DIR SNAPPY_LIBRARY)
......@@ -112,9 +112,11 @@ if(ZSTD_FOUND)
list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY})
endif()
CHECK_INCLUDE_FILE_CXX(snappy.h FOLLY_HAVE_LIBSNAPPY)
if (FOLLY_HAVE_LIBSNAPPY)
list(APPEND FOLLY_LINK_LIBRARIES snappy)
find_package(Snappy MODULE)
set(FOLLY_HAVE_LIBSNAPPY ${SNAPPY_FOUND})
if (SNAPPY_FOUND)
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${SNAPPY_INCLUDE_DIR})
list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY})
endif()
find_package(LibDwarf)
......
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