Clang can't be built out of tree on windows

This seems to be a CMake issue that I just can’t figure out. The only reason I’m sending an email to llvmdev is in hope of getting the attention of more CMake ninjas (I’m not subscribed to this list so please reply to all).

By “out of source” I mean llvm at c:/llvm and clang at c:/clang and both are configured separately so that I get two solutions.

Basically ClangDriverOptions and ClangCC1AsOptions will fail saying: ‘C:\llvm-build\bin\llvm-tblgen.exe’ is not recognized as an internal or external command

This is correct, because the actual path to tblgen has Debug in it (bin\Debug\llvm-tblgen), it should go right between those two backlashes (bin\). Only these two project call llvm-tblgen, other clang project seem to be using clang-tblgen which works fine. I’ve added some tracing to llvm/cmake/modules/tablegen.cmake where tablegen CMake macro is defined but haven’t had much success in figuring out where the wrong path is coming from.

Hi Nikola,

Basically ClangDriverOptions and ClangCC1AsOptions will fail saying:
'C:\llvm-build\bin\\llvm-tblgen.exe' is not recognized as an internal or
external command

I'm neither a Windows dev nor a CMake hacker so I probably can't help
with the real issue. But I do know there are a couple of CMake
variables that might work around it: LLVM_TABLEGEN is a path to the
.exe.

This either misses the point completely, or may help you carry on
while a proper solution is found. Or it may simply be wrong.

Cheers.

Tim.

I’m seeing a new issue with out of source builds. llvm-configure crashes with access violation when I try to configure clang. Everything works find if clang directory is inside llvm/tools.

Ignore this, it seems that a lot has changed since the last time I built…