PIC version of libclang.a is not installed

Hello,

I need a PIC version of libclang.a so I passed LIBCLANG_BUILD_STATIC=ON to cmake (LLVM_ENABLE_PIC is default to ON). I then saw both libclang.a and libclang.so built under /lib, which is expected. But libclang.a was not installed and only libclang.so was. This was a bit surprising. To debug, I printed out the cmake commands of AddClang.cmake using

cmake -G Ninja -DLIBCLANG_BUILD_STATIC=ON --trace-expand --trace-source=AddClang.cmake -Wno-dev

and checked the install command:

install(TARGETS libclang COMPONENT libclang EXPORT;ClangTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin )

It has both ARCHIVE and LIBRARY specified so it should install both .a and .so? I don’t know where to go from here. Has anyone had similar issue with this? Why is PIC libclang.a not installed?

Thanks!

Han Zhu