2019-04-11 19:28:29 +00:00
|
|
|
enable_language(ASM)
|
|
|
|
include(CheckIncludeFile)
|
2017-11-12 12:58:40 +00:00
|
|
|
|
2019-04-11 19:28:29 +00:00
|
|
|
check_include_file("sys/random.h" HAVE_SYS_RANDOM_H)
|
2018-06-18 21:14:17 +00:00
|
|
|
|
2019-04-11 19:28:29 +00:00
|
|
|
if(COMPILER_CLANG)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-builtin-requires-header")
|
|
|
|
endif()
|
|
|
|
|
2019-05-22 10:16:16 +00:00
|
|
|
add_headers_and_sources(glibc_compatibility .)
|
|
|
|
add_headers_and_sources(glibc_compatibility musl)
|
|
|
|
list(APPEND glibc_compatibility_sources musl/syscall.s musl/longjmp.s)
|
2019-04-11 19:28:29 +00:00
|
|
|
|
2019-05-22 10:16:16 +00:00
|
|
|
list(REMOVE_ITEM glibc_compatibility_sources musl/getentropy.c)
|
2019-04-11 19:28:29 +00:00
|
|
|
if(HAVE_SYS_RANDOM_H)
|
2019-05-22 10:16:16 +00:00
|
|
|
list(APPEND glibc_compatibility_sources musl/getentropy.c)
|
2019-04-11 19:28:29 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MAKE_STATIC_LIBRARIES)
|
2019-05-22 10:16:16 +00:00
|
|
|
list(APPEND glibc_compatibility_sources libcxxabi/cxa_thread_atexit.cpp)
|
2019-04-11 19:28:29 +00:00
|
|
|
endif()
|
2018-09-14 00:00:24 +00:00
|
|
|
|
2019-06-18 17:10:25 +00:00
|
|
|
add_library(glibc-compatibility STATIC ${glibc_compatibility_sources})
|
2018-09-14 00:00:24 +00:00
|
|
|
|
|
|
|
target_include_directories(glibc-compatibility PRIVATE libcxxabi)
|