[libcxx] [libcxxabi] [libunwind] [runtimes] Always define cxx_shared, cxx_static & other targets (PR #80007)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 10 15:34:55 PDT 2024
================
@@ -264,19 +263,18 @@ if (LIBCXX_ENABLE_SHARED)
APPEND_STRING PROPERTY LINK_FLAGS " -Xlinker /MANIFEST:NO")
endif()
endif()
-endif()
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
# Build the static library.
-if (LIBCXX_ENABLE_STATIC)
- add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
+ add_library(cxx_static STATIC ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(cxx_static PUBLIC cxx-headers libcxx-libc-static
PRIVATE ${LIBCXX_LIBRARIES}
PRIVATE libcxx-abi-static)
set_target_properties(cxx_static
PROPERTIES
+ EXCLUDE_FROM_ALL "$<IF:$<BOOL:${LIBCXX_ENABLE_STATIC}>,FALSE,TRUE>"
----------------
ilovepi wrote:
Is this reversed? https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#genex:IF seems to indicate that the order should be `True, False`. Or does the logic need to be inverted for `EXCLUDE_FROM_ALL`?
https://github.com/llvm/llvm-project/pull/80007
More information about the cfe-commits
mailing list