2017-09-15 07:24:53 +00:00
|
|
|
enable_language (ASM)
|
2017-11-12 12:58:40 +00:00
|
|
|
|
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
|
2018-09-14 00:00:24 +00:00
|
|
|
glibc-compatibility.c
|
2017-11-12 12:58:40 +00:00
|
|
|
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
|
2018-12-29 10:10:35 +00:00
|
|
|
musl/getrandom.c
|
2019-01-19 21:35:46 +00:00
|
|
|
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 00:00:24 +00:00
|
|
|
|
2018-09-14 01:48:56 +00:00
|
|
|
add_library (glibc-compatibility ${GLIBC_COMPATIBILITY_SOURCES})
|
2018-09-14 00:00:24 +00:00
|
|
|
|
|
|
|
target_include_directories(glibc-compatibility PRIVATE libcxxabi)
|
2017-10-07 12:03:44 +00:00
|
|
|
|
2019-01-18 18:20:07 +00:00
|
|
|
# glibc-compatibility does not depend on any libraries but is linked to all libraries implicitly.
|
|
|
|
# Avoid linking of the library to itself.
|
2019-01-18 16:35:43 +00:00
|
|
|
set_target_properties(glibc-compatibility PROPERTIES LINK_LIBRARIES "")
|
|
|
|
|
2019-01-18 18:20:07 +00:00
|
|
|
# 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")
|
2019-01-18 18:20:07 +00:00
|
|
|
|
2019-01-18 15:19:53 +00:00
|
|
|
if(ENABLE_TESTS)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
endif()
|