mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Toolchain/Clang: Fix CMake using utilities from the LLVM port
If we have the LLVM port installed, CMake might pick up some of the tools installed as part of it (`llvm-ar`, `llvm-strip`, etc.) instead of the ones belonging to the host toolchain. These, of course, can't be run on the host platform, so builds would eventually fail. This made it impossible to rebuild the LLVM toolchain. We now set these variables explicitly when compiling the LLVM runtime libraries in order to avoid this issue.
This commit is contained in:
parent
e88ca09609
commit
36bd230ffa
Notes:
sideshowbarker
2024-07-18 00:34:44 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/36bd230ffa2 Pull-request: https://github.com/SerenityOS/serenity/pull/10996 Reviewed-by: https://github.com/timschumi ✅
1 changed files with 9 additions and 4 deletions
|
@ -29,10 +29,15 @@ set(CMAKE_CXX_COMPILER_WORKS ON CACHE BOOL "")
|
|||
set(CMAKE_ASM_COMPILER "${SERENITY_TOOLCHAIN_ROOT}/bin/clang" CACHE PATH "")
|
||||
set(CMAKE_ASM_COMPILER_WORKS ON CACHE BOOL "")
|
||||
set(CMAKE_LINKER "${SERENITY_TOOLCHAIN_ROOT}/bin/ld.lld" CACHE PATH "")
|
||||
foreach(tool ranlib;nm;objdump;objcopy;strip)
|
||||
string(TOUPPER tool Tool)
|
||||
set(CMAKE_${Tool} "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-${tool}" CACHE PATH "")
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_ADDR2LINE "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-addr2line" CACHE PATH "")
|
||||
set(CMAKE_AR "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-ar" CACHE PATH "")
|
||||
set(CMAKE_NM "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-nm" CACHE PATH "")
|
||||
set(CMAKE_OBJCOPY "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-objcopy" CACHE PATH "")
|
||||
set(CMAKE_OBJDUMP "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-objdump" CACHE PATH "")
|
||||
set(CMAKE_RANLIB "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-ranlib" CACHE PATH "")
|
||||
set(CMAKE_READELF "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-readelf" CACHE PATH "")
|
||||
set(CMAKE_STRIP "${SERENITY_TOOLCHAIN_ROOT}/bin/llvm-strip" CACHE PATH "")
|
||||
|
||||
set(CMAKE_C_COMPILER_TARGET ${target_triple} CACHE STRING "")
|
||||
set(CMAKE_CXX_COMPILER_TARGET ${target_triple} CACHE STRING "")
|
||||
|
|
Loading…
Reference in a new issue