diff options
author | Wu Yingcong <yingcong.wu@intel.com> | 2024-06-20 05:00:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 07:00:19 -0500 |
commit | 89841137fbb3686673b86af3434bf3ba12993d6d (patch) | |
tree | 19b7c8cf9bc50e6fd7b46578ede72c6cbbf5c669 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 993c12b3177554d7915cde501fe5bddaa95dadae (diff) | |
download | llvm-89841137fbb3686673b86af3434bf3ba12993d6d.zip llvm-89841137fbb3686673b86af3434bf3ba12993d6d.tar.gz llvm-89841137fbb3686673b86af3434bf3ba12993d6d.tar.bz2 |
[offload][cmake] always define pythonize_bool macro (#96028)
I use the following cmake config to build offload and openmp
```
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_RUNTIMES="offload" -DLLVM_LIT_ARGS="-vv -a" -DLLVM_ENABLE_ASSERTIONS=ON ../llvm
```
and got the following error:
```
CMake Error at /tmp/build-llvm/llvm/offload/CMakeLists.txt:321 (pythonize_bool):
Unknown CMake command "pythonize_bool".
```
After some search I find out that the "correct" way to build this is
putting openmp and offload to the ENABLE_RUNTIMES like
```
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="openmp;offload" -DLLVM_LIT_ARGS="-vv -a" -DLLVM_ENABLE_ASSERTIONS=ON ../llvm
```
.
But since we don't forbid to config them using openmp as PROJECT and
offload as RUNTIME, then we probably support it. The fix is to always
define the pythonize_bool macro. For cmake, it is okay to redefine a
macro, it does not cause a warning or else.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions