X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=thirdparty%2Fsnappy%2FCMakeLists.txt;h=25281a6b981cbadb818dced2f75dec654582c011;hb=8fae49d8ccee46f43bb06f035dd5b3ea105ba3aa;hp=bcacda7514a8acf632548d73fcff59e01d78d161;hpb=a384e61261c518ab374e4965261bc6ce23f741b0;p=apitrace diff --git a/thirdparty/snappy/CMakeLists.txt b/thirdparty/snappy/CMakeLists.txt index bcacda7..25281a6 100644 --- a/thirdparty/snappy/CMakeLists.txt +++ b/thirdparty/snappy/CMakeLists.txt @@ -1,40 +1,14 @@ -# We only do the subset of the snappy autoconf that actually affect the library -# (as most of them are for the tests which we don't build.) - -include (CheckIncludeFileCXX) -include (CheckCXXSourceCompiles) -include (TestBigEndian) - -check_include_file_cxx (sys/mman.h HAVE_SYS_MMAN_H) -check_include_file_cxx (sys/byteorder.h HAVE_SYS_BYTEORDER_H) -check_include_file_cxx (sys/endian.h HAVE_SYS_ENDIAN_H) -check_include_file_cxx (byteswap.h HAVE_BYTESWAP_H) - -check_cxx_source_compiles ( - "main() { return __builtin_expect(1, 1) ? 1 : 0; }" - HAVE_BUILTIN_EXPECT +add_definitions ( + -DNDEBUG + -DHAVE_CONFIG_H ) -check_cxx_source_compiles ( - "main() { return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0; }" - HAVE_BUILTIN_CTZ -) - -test_big_endian (WORDS_BIGENDIAN) - -configure_file (config.h.in config.h) - -add_definitions (-DHAVE_CONFIG_H) - # Adjust warnings if (CMAKE_COMPILER_IS_GNUCXX) add_definitions (-Wno-unused-function) endif () - -include_directories (${CMAKE_CURRENT_BINARY_DIR}) - -add_library (snappy_bundled STATIC +add_library (snappy_bundled STATIC EXCLUDE_FROM_ALL snappy.cc snappy-sinksource.cc snappy-stubs-internal.cc @@ -45,11 +19,8 @@ set_target_properties (snappy_bundled PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}" ) -# If we're doing an out of source build remove any config.h from the source tree. -if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) - add_custom_command ( - TARGET snappy_bundled - PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_CURRENT_SOURCE_DIR}/config.h - ) -endif() +install ( + FILES COPYING + DESTINATION ${DOC_INSTALL_DIR} + RENAME LICENSE-snappy.txt +)