diff options
author | Han Zhu <zhuhan@fb.com> | 2020-04-27 13:36:52 -0700 |
---|---|---|
committer | Shoaib Meenai <smeenai@fb.com> | 2020-04-27 13:37:07 -0700 |
commit | f8990feb125a0f8d3f2892a589bc6fad3c430858 (patch) | |
tree | 2e955fc6316d113b1a16f93242e3476b73f74b16 /llvm/lib/Support/SmallVector.cpp | |
parent | 9598778bd1910e77ccd399f2c9e979c8ecf98e55 (diff) | |
download | llvm-f8990feb125a0f8d3f2892a589bc6fad3c430858.zip llvm-f8990feb125a0f8d3f2892a589bc6fad3c430858.tar.gz llvm-f8990feb125a0f8d3f2892a589bc6fad3c430858.tar.bz2 |
[libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON
When LIBCLANG_BUILD_STATIC=ON and LLVM_ENABLE_PIC=ON, PIC version of
libclang.a and libclang.so are built as expected. However libclang.a is
not installed. Looking at the macro llvm_add_library(), when both SHARED
and STATIC are set, it renames the static library to ${name}_static and
then adds it to targets. But when add_clang_library() calls install, it
only checks if ${name} is in targets.
To work around this issue, loop through both ${name} and ${name}_static
and install both of them if they're in targets. This is still correct if
only shared or static library is built. In those cases, only ${name} is
added to targets and cmake install will generate the right install
script depending on the library's type.
Test Plan:
cmake with LIBCLANG_BUILD_STATIC=ON and then ninja install, from master
and this diff. Compare the result directory trees. Confirm that only
difference is the added libclang.a.
Differential Revision: https://reviews.llvm.org/D78534
Diffstat (limited to 'llvm/lib/Support/SmallVector.cpp')
0 files changed, 0 insertions, 0 deletions