Skip to content

Does LLVM_ENABLE_PROJECTS=compiler-rt need to be adapted on win #146279

Closed
@GkvJwa

Description

@GkvJwa

I used the main branch and noticed the following warning(#124016)

-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;compiler-rt"

CMake Warning at CMakeLists.txt:189 (message):
  Using LLVM_ENABLE_PROJECTS=compiler-rt is deprecated now, and will become a
  fatal error in the LLVM 21 release.  Please use
  -DLLVM_ENABLE_RUNTIMES=compiler-rt or see the instructions at
  https://compiler-rt.llvm.org/ for building the runtimes.

So I maked with -DLLVM_ENABLE_RUNTIMES="compiler-rt"

However, just using LLVM_ENABLE_RUNTIMES will cause the following problems

-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt"

-- clang project is enabled
-- clang-tools-extra project is enabled
-- compiler-rt project is disabled
-- cross-project-tests project is disabled

This is due to ${proj}(compiler-rt) is not in LLVM_ENABLE_PROJECTS, The project will not be generated

set(LLVM_ENABLE_PROJECTS_USED OFF CACHE BOOL "")
mark_as_advanced(LLVM_ENABLE_PROJECTS_USED)
if (LLVM_ENABLE_PROJECTS_USED OR NOT LLVM_ENABLE_PROJECTS STREQUAL "")
set(LLVM_ENABLE_PROJECTS_USED ON CACHE BOOL "" FORCE)
foreach(proj ${LLVM_KNOWN_PROJECTS} ${LLVM_EXTERNAL_PROJECTS})
string(TOUPPER "${proj}" upper_proj)
string(REGEX REPLACE "-" "_" upper_proj ${upper_proj})
if ("${proj}" IN_LIST LLVM_ENABLE_PROJECTS)
message(STATUS "${proj} project is enabled")
set(SHOULD_ENABLE_PROJECT TRUE)

Does LLVM_ENABLE_PROJECTS=compiler-rt need to be adapted or is there any other command?

@petrhosek Can you help me with this problem if you have time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions