mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:27:44 +00:00
Meta: Add Clang support to the CMake build scripts
This commit is contained in:
parent
15e217ea68
commit
13e3df41de
7 changed files with 128 additions and 22 deletions
|
@ -32,6 +32,12 @@ set_source_files_properties (../Libraries/LibC/ssp.cpp PROPERTIES COMPILE_FLAGS
|
|||
"-fno-stack-protector")
|
||||
|
||||
add_executable(Loader.so ${SOURCES})
|
||||
target_link_libraries(Loader.so gcc)
|
||||
|
||||
if (USE_CLANG_TOOLCHAIN)
|
||||
target_link_libraries(Loader.so clang_rt.builtins-${SERENITY_CLANG_ARCH})
|
||||
else()
|
||||
target_link_libraries(Loader.so gcc)
|
||||
endif()
|
||||
|
||||
target_link_options(Loader.so PRIVATE LINKER:--no-dynamic-linker)
|
||||
install(TARGETS Loader.so RUNTIME DESTINATION usr/lib/)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue