summaryrefslogtreecommitdiff
path: root/Kernel/Prekernel
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-09-07 02:21:36 -0600
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-09-15 19:04:52 +0430
commitb5c98ede084e5d29b8586f3bb2bf134184d372be (patch)
tree7f4ece17df372bbe5dd27c5063b67195e1f578ea /Kernel/Prekernel
parent904a268872416dc9b9f26c83fd0b1bd8b715c511 (diff)
downloadserenity-b5c98ede084e5d29b8586f3bb2bf134184d372be.zip
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.
Diffstat (limited to 'Kernel/Prekernel')
-rw-r--r--Kernel/Prekernel/CMakeLists.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Prekernel/CMakeLists.txt b/Kernel/Prekernel/CMakeLists.txt
index 1da2421bae..6d1d7704d8 100644
--- a/Kernel/Prekernel/CMakeLists.txt
+++ b/Kernel/Prekernel/CMakeLists.txt
@@ -43,10 +43,10 @@ target_compile_options(${PREKERNEL_TARGET} PRIVATE -no-pie -fno-pic -fno-threads
target_link_options(${PREKERNEL_TARGET} PRIVATE LINKER:-T ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld -nostdlib LINKER:--no-pie)
set_target_properties(${PREKERNEL_TARGET} PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld)
-if (USE_CLANG_TOOLCHAIN)
- target_link_libraries(${PREKERNEL_TARGET} clang_rt.builtins-${SERENITY_CLANG_ARCH} c++abi)
-else()
- target_link_libraries(${PREKERNEL_TARGET} gcc)
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ target_link_libraries(${PREKERNEL_TARGET} PRIVATE kernel_heap gcc)
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
+ target_link_libraries(${PREKERNEL_TARGET} PRIVATE kernel_heap "clang_rt.builtins-${SERENITY_CLANG_ARCH}" c++abi)
endif()
if ("${SERENITY_ARCH}" STREQUAL "i686" OR "${SERENITY_ARCH}" STREQUAL "x86_64")