CMake freaks out in trivial cases like:
cmake -G Ninja -DLLVM_ENABLE_PIC=Off -DLLVM_INSTALL_TOOLCHAIN_ONLY=On ../llvm
This is a result of static ink dependencies not all being part of the same export group, and was caused by r249935.
Differential D16158
[CMake] Add clang's targets to LLVM's export set when not building standalone Authored by beanz on Jan 13 2016, 2:57 PM.
Details
Diff Detail Event TimelineComment Actions Sorry the previous change caused this configuration to break. However, I'm not sure about adding LLVMExports here. Shouldn't that be handled in llvm/CMakeLists.txt? In fact, this looks like a cmake bug (or feature) that won't let you export a target that depends on a static lib without also exporting that static lib. Since you've set LLVM_INSTALL_TOOLCHAIN_ONLY, you don't want to export those statics libs anyway, since they won't be available. I'll play around with it and see if I can come up with something that works for all configurations. Comment Actions @hintonda, your comment actually trigged something in my brain and I just realized the problem. It is a much simpler fix. If you set LLVM_ENABLE_PIC=Off libclang isn't built as a dylib, it is a static lib. If LLVM_INSTALL_TOOLCHAIN_ONLY=On, we need to exclude all static libraries from the Clang exports file. |