https://github.com/danielotero created 
https://github.com/llvm/llvm-project/pull/95979

Since commit 8d468c132eed7ffe34d601b224220efd51655eb3, the header 
`openmp_wrappers/complex` is hidden behind `openmp_wrappers/complex.h` due to a 
bug in CMake[^1], so is not actually installed.

To test the issue, you can ask `ninja` to generate the file on your build:

```
$ ninja lib/clang/19/include/openmp_wrappers/complex.h
[199/199] Copying clang's openmp_wrappers/complex.h...
$ ninja lib/clang/19/include/openmp_wrappers/complex
ninja: error: unknown target 'lib/clang/19/include/openmp_wrappers/complex', 
did you mean 'lib/clang/19/include/openmp_wrappers/complex.h'? 
```

Re-ordering the entries workarounds the issue. The other option is to revert 
the cited commit, but I'm not sure which approach is preferred.

CC @etcwilde @jdoerfert 

[^1]: [Here](https://gitlab.kitware.com/cmake/cmake/-/issues/26058) is the 
CMake report on the issue.

>From d46e144bce7d95518a779ea7ce63564b27da7d3f Mon Sep 17 00:00:00 2001
From: Daniel Otero <otero.o.dan...@gmail.com>
Date: Tue, 18 Jun 2024 21:30:59 +0200
Subject: [PATCH] [clang] Fix missing installed header

Since commit 8d468c132eed7ffe34d601b224220efd51655eb3, the header
`openmp_wrappers/complex` is hidden behind `openmp_wrappers/complex.h`
due to a bug in CMake, so is not actually installed.

Re-ordering the entries workarounds the issue.

See https://gitlab.kitware.com/cmake/cmake/-/issues/26058 for more
information on the CMake bug.
---
 clang/lib/Headers/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index d3090e488306f..89fa0ecd45eb4 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -318,8 +318,10 @@ set(ppc_wrapper_files
 set(openmp_wrapper_files
   openmp_wrappers/math.h
   openmp_wrappers/cmath
-  openmp_wrappers/complex.h
+  # Due to a bug in CMake, `complex` must be before `complex.h`
+  # See: https://gitlab.kitware.com/cmake/cmake/-/issues/26058
   openmp_wrappers/complex
+  openmp_wrappers/complex.h
   openmp_wrappers/__clang_openmp_device_functions.h
   openmp_wrappers/complex_cmath.h
   openmp_wrappers/new

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

Reply via email to