1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:48:13 +00:00

Meta: Add Clang support to the CMake build scripts

This commit is contained in:
Daniel Bertalan 2021-07-13 16:43:45 +02:00 committed by Andreas Kling
parent 15e217ea68
commit 13e3df41de
7 changed files with 128 additions and 22 deletions

View file

@ -51,6 +51,9 @@ function(serenity_libc target_name fs_name)
add_library(${target_name} SHARED ${SOURCES})
install(TARGETS ${target_name} DESTINATION usr/lib)
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name})
if (USE_CLANG_TOOLCHAIN)
target_link_libraries(${target_name} clang_rt.builtins-${SERENITY_CLANG_ARCH})
endif()
target_link_directories(LibC PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
serenity_generated_sources(${target_name})
endfunction()

View file

@ -44,10 +44,11 @@ else
rsync -aH --inplace Root/ mnt/
chown -R 0:0 mnt/
fi
SERENITY_ARCH="${SERENITY_ARCH:-i686}"
LLVM_VERSION="${LLVM_VERSION:-12.0.1}"
if [ "$USE_CLANG_TOOLCHAIN" = "ON" ]; then
if [ "$USE_CLANG_TOOLCHAIN" = "1" ]; then
TOOLCHAIN_DIR="$SERENITY_SOURCE_DIR"/Toolchain/Local/clang/"$SERENITY_ARCH"
mkdir -p mnt/usr/lib/clang/"$LLVM_VERSION"/lib/serenity
$CP "$TOOLCHAIN_DIR"/lib/clang/"$LLVM_VERSION"/lib/serenity/* mnt/usr/lib/clang/"$LLVM_VERSION"/lib/serenity