[libcxx-commits] [PATCH] D71894: [libcxxabi] Allow tests to link with static libc++abi/libc++ even if the shared version is present

Sergej Jaskiewicz via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 26 03:37:21 PST 2019


broadwaylamb marked 2 inline comments as done.
broadwaylamb added inline comments.


================
Comment at: libcxxabi/CMakeLists.txt:240
   set(LIBCXXABI_LIBCXX_LIBRARY_PATH "${LIBCXXABI_LIBRARY_DIR}" CACHE PATH
-      "The path to libc++ library.")
+      "The path to libc++ library." FORCE)
 endif()
----------------
This is not dangerous: earlier we by default set `LIBCXXABI_LIBCXX_LIBRARY_PATH` to empty string and cache it. If the user overrides this setting with some value, this code path is never hit.

However, this change is required if the user doesn't override this variable: since we already cached the default value (the empty string), this code path is hit, but it doesn't do anything, because earliest `CACHE` wins, unless we use `FORCE`.


================
Comment at: libcxxabi/test/lit.site.cfg.in:19-20
 config.executor                 = "@LIBCXXABI_EXECUTOR@"
-config.libcxxabi_shared         = @LIBCXXABI_ENABLE_SHARED@
-config.enable_shared            = @LIBCXX_ENABLE_SHARED@
+config.libcxxabi_shared         = @LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI@
+config.enable_shared            = @LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX@
 config.enable_exceptions        = @LIBCXXABI_ENABLE_EXCEPTIONS@
----------------
Note that `LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI` and `LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX` are by default set to `LIBCXXABI_ENABLE_SHARED` and `LIBCXX_ENABLE_SHARED` respectively, which makes this change non-breaking.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71894/new/

https://reviews.llvm.org/D71894





More information about the libcxx-commits mailing list