diff options
author | Andrew Kaster <akaster@serenityos.org> | 2021-09-07 02:21:36 -0600 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-09-15 19:04:52 +0430 |
commit | b5c98ede084e5d29b8586f3bb2bf134184d372be (patch) | |
tree | 7f4ece17df372bbe5dd27c5063b67195e1f578ea /Userland/DynamicLoader | |
parent | 904a268872416dc9b9f26c83fd0b1bd8b715c511 (diff) | |
download | serenity-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 'Userland/DynamicLoader')
-rw-r--r-- | Userland/DynamicLoader/CMakeLists.txt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Userland/DynamicLoader/CMakeLists.txt b/Userland/DynamicLoader/CMakeLists.txt index 1e4e3ad764..31f46e3de2 100644 --- a/Userland/DynamicLoader/CMakeLists.txt +++ b/Userland/DynamicLoader/CMakeLists.txt @@ -39,11 +39,10 @@ set_source_files_properties(../Libraries/LibC/stdio.cpp PROPERTIES COMPILE_FLAGS add_executable(Loader.so ${SOURCES}) -if (USE_CLANG_TOOLCHAIN) - target_link_libraries(Loader.so clang_rt.builtins-${SERENITY_CLANG_ARCH}) -else() - target_link_libraries(Loader.so gcc) -endif() - +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_link_libraries(Loader.so PRIVATE gcc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$") + target_link_libraries(Loader.so PRIVATE "clang_rt.builtins-${SERENITY_CLANG_ARCH}") +endif () target_link_options(Loader.so PRIVATE LINKER:--no-dynamic-linker) install(TARGETS Loader.so RUNTIME DESTINATION usr/lib/) |