mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 18:05:07 +00:00

Since https://reviews.llvm.org/D131441, libc++ must be included before LibC. As clang includes libc++ as one of the system includes, LibC must be included after those, and the only correct way to do that is to install LibC's headers into the sysroot. Targets that don't link with LibC yet require its headers for one reason or another must add install_libc_headers as a dependency to ensure that the correct headers have been (re)installed into the sysroot. LibC/stddef.h has been dropped since the built-in stddef.h receives a higher include priority. In addition, string.h and wchar.h must define __CORRECT_ISO_CPP_STRING_H_PROTO and _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS respectively in order to tell libc++ to not try to define methods implemented by LibC.
16 lines
578 B
CMake
16 lines
578 B
CMake
|
|
# HACK ALERT!
|
|
# To avoid a circular dependency chain with LibCrypt --> LibCrypto --> LibCore --> LibCrypt
|
|
# We include the SHA2 implementation from LibCrypto here manually
|
|
add_library(LibCryptSHA2 OBJECT ../LibCrypto/Hash/SHA2.cpp)
|
|
add_dependencies(LibCryptSHA2 install_libc_headers)
|
|
set_target_properties(LibCryptSHA2 PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
|
set_target_properties(LibCryptSHA2 PROPERTIES VISIBILITY_INLINES_HIDDEN ON)
|
|
|
|
set(SOURCES
|
|
crypt.cpp
|
|
)
|
|
|
|
serenity_lib(LibCrypt crypt)
|
|
serenity_install_headers("")
|
|
target_link_libraries(LibCrypt PRIVATE LibCryptSHA2)
|