[libcxx] [libcxxabi] [libunwind] [runtimes] Always define cxx_shared, cxx_static & other targets (PR #80007)
Louis Dionne via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 11 09:13:43 PDT 2024
ldionne wrote:
If other folks get here because of an error like `multiple rules generate lib/SOMETHING.a`, this is the issue (from https://github.com/llvm/llvm-project/pull/80007#issuecomment-2402188675):
>
> The fix for this is:
>
> ```
> # On embedded platforms that don't support shared library targets, CMake implicitly changes shared
> # library targets to be static library targets. This results in duplicate definitions of the static
> # library targets even though we might not ever build the shared library target, which breaks the
> # build. To work around this, we change the output name of the shared library target so that it
> # can't conflict with the static library target.
> #
> # This is tracked by https://gitlab.kitware.com/cmake/cmake/-/issues/25759.
> set(LIBCXX_SHARED_OUTPUT_NAME "c++-shared" CACHE STRING "")
> set(LIBCXXABI_SHARED_OUTPUT_NAME "c++abi-shared" CACHE STRING "")
> set(LIBUNWIND_SHARED_OUTPUT_NAME "unwind-shared" CACHE STRING "")
> ```
Also, please consider pinging the CMake issue referenced.
https://github.com/llvm/llvm-project/pull/80007
More information about the cfe-commits
mailing list