Issue 68895
Summary [Clang][OpenMP] Building clang with openmp runtime as a cmake subproject fails
Labels clang
Assignees
Reporter theComputeKid
    I would like to build clang as part of a cmake project. In my main `CMakeLists.txt`, I add:

```
include(FetchContent)
FetchContent_Declare(
 llvm-project
  GIT_REPOSITORY https://github.com/llvm/llvm-project.git
 GIT_TAG llvmorg-17.0.2
  GIT_SHALLOW TRUE
  GIT_PROGRESS TRUE
 SOURCE_SUBDIR llvm
)
FetchContent_MakeAvailable(llvm-project)
```
I then send the following flags to my project, that are then passed down to LLVM:
```
"LLVM_ENABLE_PROJECTS": "clang;openmp"
```

Everything works.

Now, I change the flags to:

```
"LLVM_ENABLE_PROJECTS": "clang"
"LLVM_ENABLE_RUNTIMES" : "openmp"
```

I get the following error:
```
The dependency target "clang" of target "check-openmp" does not exist.
```

This is on an Apple Silicon Mac. A similar issue has been reported here by others, but left unanswered:
[https://discourse.llvm.org/t/dependency-errors-when-building-as-subdirectory/72830](url)

For context, the use case is to do the following in one project:
1. Build clang with OpenMP.
2. Build my code with that clang.

It works, but only when openmp is specified as a project, but not as a runtime.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to