mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
Meta: Switch to a SuperBuild that splits host and target builds
Replace the old logic where we would start with a host build, and swap all the CMake compiler and target variables underneath it to trick CMake into building for Serenity after we configured and built the Lagom code generators. The SuperBuild creates two ExternalProjects, one for Lagom and one for Serenity. The Serenity project depends on the install stage for the Lagom build. The SuperBuild also generates a CMakeToolchain file for the Serenity build to use that replaces the old toolchain file that was only used for Ports. To ensure that code generators are rebuilt when core libraries such as AK and LibCore are modified, developers will need to direct their manual `ninja` invocations to the SuperBuild's binary directory instead of the Serenity binary directory. This commit includes warning coalescing and option style cleanup for the affected CMakeLists in the Kernel, top level, and runtime support libraries. A large part of the cleanup is replacing USE_CLANG_TOOLCHAIN with the proper CMAKE_CXX_COMPILER_ID variable, which will no longer be confused by a host clang compiler.
This commit is contained in:
parent
904a268872
commit
b5c98ede08
15 changed files with 403 additions and 335 deletions
|
@ -56,8 +56,8 @@ 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})
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
|
||||
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})
|
||||
|
@ -101,7 +101,6 @@ function(serenity_test test_src sub_dir)
|
|||
install(TARGETS ${test_name} RUNTIME DESTINATION usr/Tests/${sub_dir} OPTIONAL)
|
||||
endfunction()
|
||||
|
||||
|
||||
function(serenity_testjs_test test_src sub_dir)
|
||||
cmake_parse_arguments(PARSE_ARGV 2 SERENITY_TEST "" "CUSTOM_MAIN" "LIBS")
|
||||
if ("${SERENITY_TEST_CUSTOM_MAIN}" STREQUAL "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue