1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
llvm-mirror/lib/WindowsManifest/CMakeLists.txt
serge-sans-paille 82b6e6053d llvmbuildectomy - replace llvm-build by plain cmake
No longer rely on an external tool to build the llvm component layout.

Instead, leverage the existing `add_llvm_componentlibrary` cmake function and
introduce `add_llvm_component_group` to accurately describe component behavior.

These function store extra properties in the created targets. These properties
are processed once all components are defined to resolve library dependencies
and produce the header expected by llvm-config.

Differential Revision: https://reviews.llvm.org/D90848
2020-11-13 10:35:24 +01:00

35 lines
1009 B
CMake

include(GetLibraryName)
if(LLVM_ENABLE_LIBXML2)
set(imported_libs LibXml2::LibXml2)
endif()
add_llvm_component_library(LLVMWindowsManifest
WindowsManifestMerger.cpp
ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/WindowsManifest
${Backtrace_INCLUDE_DIRS}
LINK_LIBS
${imported_libs}
LINK_COMPONENTS
Support
)
# This block is only needed for llvm-config. When we deprecate llvm-config and
# move to using CMake export, this block can be removed.
if(LLVM_ENABLE_LIBXML2)
# CMAKE_BUILD_TYPE is only meaningful to single-configuration generators.
if(CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type})
endif()
if(NOT zlib_library)
get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION)
endif()
get_library_name(${libxml2_library} libxml2_library)
set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library})
endif()