ClickHouse/libs/libglibc-compatibility/CMakeLists.txt

50 lines
1.5 KiB
CMake
Raw Normal View History

enable_language (ASM)
2018-06-18 21:14:17 +00:00
if (COMPILER_CLANG)
2018-06-18 21:15:35 +00:00
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-builtin-requires-header")
2018-06-18 21:14:17 +00:00
endif ()
2018-09-14 01:48:56 +00:00
set (GLIBC_COMPATIBILITY_SOURCES
glibc-compatibility.c
musl/pipe2.c
musl/fallocate.c
musl/longjmp.s
musl/vasprintf.c
musl/lgamma.c
musl/posix_spawn.c
musl/futimens.c
musl/syscall.s
musl/syscall_ret.c
2018-05-11 11:54:25 +00:00
musl/sched_cpucount.c
musl/glob.c
2018-09-14 02:48:24 +00:00
musl/exp2f.c
2018-12-10 18:16:15 +00:00
musl/pwritev.c
musl/getrandom.c
musl/fcntl.c
musl/timespec_get.c
musl/sched_getcpu.c
)
2018-09-14 01:48:56 +00:00
if (MAKE_STATIC_LIBRARIES)
set (GLIBC_COMPATIBILITY_SOURCES ${GLIBC_COMPATIBILITY_SOURCES}
2018-09-14 01:59:05 +00:00
libcxxabi/cxa_thread_atexit.cpp)
2018-09-14 01:48:56 +00:00
endif ()
2018-09-14 01:48:56 +00:00
add_library (glibc-compatibility ${GLIBC_COMPATIBILITY_SOURCES})
target_include_directories(glibc-compatibility PRIVATE libcxxabi)
# glibc-compatibility does not depend on any libraries but is linked to all libraries implicitly.
# Avoid linking of the library to itself.
set_target_properties(glibc-compatibility PROPERTIES LINK_LIBRARIES "")
# Garbage. Rough explanation: some libraries want to install itself and CMake forces us to also install the glibc-compatibility library.
install(TARGETS glibc-compatibility EXPORT CapnProtoTargets ARCHIVE DESTINATION "/tmp")
install(TARGETS glibc-compatibility EXPORT protobuf-targets ARCHIVE DESTINATION "/tmp")
install(TARGETS glibc-compatibility EXPORT double-conversionTargets ARCHIVE DESTINATION "/tmp")
2019-02-19 20:51:44 +00:00
install(TARGETS glibc-compatibility EXPORT SnappyTargets ARCHIVE DESTINATION "/tmp")
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()