When LLVM_ENABLE_PIC = OFF, shared libraries cannot be built against code that's compiled without -fPIC. Example error message:
ld.lld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in lib/libLLVMSupport.a(StringMap.cpp.o) >>> referenced by StringMap.cpp >>> StringMap.cpp.o:(llvm::StringMapImpl::StringMapImpl(unsigned int, unsigned int)) in archive lib/libLLVMSupport.a
Similar to how libclang handles this, skip building these shared libraries when LLVM_ENABLE_PIC = OFF.
There's other libraries like this one marked with SHARED too. What's different about this one? Not linking against LLVM?
Is the MLIR Exectutiong engine still useful without the two libs excluded here? Otherwise there is already a if(NOT MLIR_ENABLE_EXECUTION_ENGINE) return() endif() above which could be used to just disable it all if LLVM_ENABLE_PIC is false...