1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:57:35 +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

@ -110,7 +110,10 @@ add_custom_command(
set(SOURCES ${LIBC_SOURCES} ${AK_SOURCES} ${ELF_SOURCES} ${ASM_SOURCES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
if (NOT USE_CLANG_TOOLCHAIN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
endif()
add_library(LibCStaticWithoutDeps STATIC ${SOURCES})
target_link_libraries(LibCStaticWithoutDeps ssp)
add_dependencies(LibCStaticWithoutDeps LibM LibSystem LibUBSanitizer)
@ -133,7 +136,7 @@ set_property(
PROPERTY ADDITIONAL_CLEAN_FILES ${TEMP_OBJ_FILES}
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nolibc")
serenity_libc(LibC c)
add_dependencies(LibC crti crt0 crt0_shared crtn)
target_link_libraries(LibC ssp system)