Hi, I’d like to generate a clang compilation database for my project but have had trouble getting UBT to recognize clang on my machine.
I’ve tried both the version from the LLVM site (enabling the “add to path” option in the installer) and the version from the Visual Studio installer (temporarily adding clang’s bin directory to the path myself and setting CC and CXX to the correct values). Here’s the command I ran in powershell:
& 'Path\To\Build.bat' -mode=GenerateClangDatabase -project="Path\To\BatteryCollector\BatteryCollector.uproject" BatteryCollector Development Win64
The output is as follows:
ERROR: Clang must be installed in order to build this target.
Am I doing anything wrong?
I have tried looking at the UBT source code and have found where the error is emitted but it’s just a rabbit hole of classes and factory methods and I’m having a hard time finding where exactly it looks for clang.
I’m using version 4.25.3 but have faced the same issues with 4.25.2.