diff options
author | Louis Dionne <ldionne.2@gmail.com> | 2022-09-19 16:17:02 -0400 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2022-10-12 09:36:29 -0400 |
commit | 79ee0342dbf025bc70f237bdfe9ccb4e10a592ce (patch) | |
tree | e0d18a4af06beadd99098956a41496835aa7a6b8 /libcxx/cmake | |
parent | ec2640bf3a5221a3ac58f25b34976be6264e8e21 (diff) | |
download | llvm-79ee0342dbf025bc70f237bdfe9ccb4e10a592ce.tar.gz |
[runtimes] Always define cxx_shared, cxx_static & other targets
However, mark them as EXCLUDE_FROM_ALL when we don't want to build them.
Simply declaring the targets should be of no harm, and it allows other
projects to mention these targets regardless of whether they end up
being built or not.
While the diff may not make that obvious, this patch basically
moves the definition of e.g. `cxx_shared` out of the `if (LIBCXX_ENABLE_SHARED)`
and instead marks it as `EXCLUDE_FROM_ALL` conditionally on whether
LIBCXX_ENABLE_SHARED is passed. It then does the same for libunwind
and libc++abi targets.
Differential Revision: https://reviews.llvm.org/D134221
Diffstat (limited to 'libcxx/cmake')
-rw-r--r-- | libcxx/cmake/caches/AIX.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/cmake/caches/AIX.cmake b/libcxx/cmake/caches/AIX.cmake index 76cf17791301..d4eb9ac42743 100644 --- a/libcxx/cmake/caches/AIX.cmake +++ b/libcxx/cmake/caches/AIX.cmake @@ -17,3 +17,10 @@ set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "") set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") set(LIBUNWIND_ENABLE_SHARED ON CACHE BOOL "") set(LIBUNWIND_ENABLE_STATIC OFF CACHE BOOL "") + +# On AIX, both shared and static libraries are archived. As a result, both the static and the shared targets end +# up with a `.a` suffix, which conflict. To workaround that, we set a different output name for the static +# libraries, which we never actually build anyway. For more information, see https://gitlab.kitware.com/cmake/cmake/-/issues/19494. +set(LIBCXX_STATIC_OUTPUT_NAME "c++-static" CACHE STRING "") +set(LIBCXXABI_STATIC_OUTPUT_NAME "c++abi-static" CACHE STRING "") +set(LIBUNWIND_STATIC_OUTPUT_NAME "unwind-static" CACHE STRING "") |