1 # We only do the subset of the snappy autoconf that actually affect the library
2 # (as most of them are for the tests which we don't build.)
4 include (CheckIncludeFileCXX)
5 include (CheckCXXSourceCompiles)
6 include (TestBigEndian)
8 check_include_file_cxx (sys/mman.h HAVE_SYS_MMAN_H)
10 check_cxx_source_compiles (
11 "main() { return __builtin_expect(1, 1) ? 1 : 0; }"
15 check_cxx_source_compiles (
16 "main() { return (__builtin_ctzll(0x100000000LL) == 32) ? 1 : 0; }"
20 test_big_endian (WORDS_BIGENDIAN)
22 configure_file (config.h.in config.h)
24 add_definitions (-DHAVE_CONFIG_H)
27 include_directories (${CMAKE_CURRENT_BINARY_DIR})
29 add_library (snappy_bundled STATIC
32 snappy-stubs-internal.cc
36 set_target_properties (snappy_bundled PROPERTIES
37 COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"