From 36be14cbfea5607de14cdbd3785d8de7e89a4ce5 Mon Sep 17 00:00:00 2001 From: Eric Beckmann Date: Wed, 26 Jul 2017 01:21:55 +0000 Subject: [PATCH] Move manifest utils into separate lib, to reduce libxml2 deps. Summary: Previously were in support. Since many many things depend on support, were all forced to also depend on libxml2, which we only want in a few cases. This puts all the libxml2 deps in a separate lib to be used only in a few places. Reviewers: ruiu, thakis, rnk Subscribers: mgorny, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D35819 llvm-svn: 309070 --- .../WindowsManifestMerger.h | 0 llvm/include/llvm/module.modulemap | 6 +++++ llvm/lib/CMakeLists.txt | 1 + llvm/lib/LLVMBuild.txt | 1 + llvm/lib/Support/CMakeLists.txt | 4 ---- llvm/lib/WindowsManifest/CMakeLists.txt | 18 +++++++++++++++ llvm/lib/WindowsManifest/LLVMBuild.txt | 22 +++++++++++++++++++ .../WindowsManifestMerger.cpp | 2 +- llvm/tools/llvm-mt/CMakeLists.txt | 1 + llvm/tools/llvm-mt/LLVMBuild.txt | 2 +- llvm/tools/llvm-mt/llvm-mt.cpp | 2 +- 11 files changed, 52 insertions(+), 7 deletions(-) rename llvm/include/llvm/{Support => WindowsManifest}/WindowsManifestMerger.h (100%) create mode 100644 llvm/lib/WindowsManifest/CMakeLists.txt create mode 100644 llvm/lib/WindowsManifest/LLVMBuild.txt rename llvm/lib/{Support => WindowsManifest}/WindowsManifestMerger.cpp (99%) diff --git a/llvm/include/llvm/Support/WindowsManifestMerger.h b/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h similarity index 100% rename from llvm/include/llvm/Support/WindowsManifestMerger.h rename to llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h diff --git a/llvm/include/llvm/module.modulemap b/llvm/include/llvm/module.modulemap index 3c0c45f585d9e..e95d0fcd5656f 100644 --- a/llvm/include/llvm/module.modulemap +++ b/llvm/include/llvm/module.modulemap @@ -306,3 +306,9 @@ module LLVM_Support_DataTypes_Src { header "llvm/Support/DataTypes.h" export * } + +module LLVM_WindowsManifest { + requires cplusplus + umbrella "WindowsManifest" + module * { export * } +} diff --git a/llvm/lib/CMakeLists.txt b/llvm/lib/CMakeLists.txt index 946067e6358f3..71b0a0aa0d389 100644 --- a/llvm/lib/CMakeLists.txt +++ b/llvm/lib/CMakeLists.txt @@ -25,3 +25,4 @@ add_subdirectory(Passes) add_subdirectory(ToolDrivers) add_subdirectory(XRay) add_subdirectory(Testing) +add_subdirectory(WindowsManifest) diff --git a/llvm/lib/LLVMBuild.txt b/llvm/lib/LLVMBuild.txt index 1d22c2a11f131..91c3da53172cf 100644 --- a/llvm/lib/LLVMBuild.txt +++ b/llvm/lib/LLVMBuild.txt @@ -42,6 +42,7 @@ subdirectories = Testing ToolDrivers Transforms + WindowsManifest [component_0] type = Group diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index e258e4df79924..0a8e3897cce92 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -27,9 +27,6 @@ elseif( CMAKE_HOST_UNIX ) if( UNIX AND NOT (BEOS OR HAIKU) ) set(system_libs ${system_libs} m) endif() - if( LLVM_LIBXML2_ENABLED ) - set(system_libs ${system_libs} ${LIBXML2_LIBS}) - endif() endif( MSVC OR MINGW ) add_llvm_library(LLVMSupport @@ -113,7 +110,6 @@ add_llvm_library(LLVMSupport Triple.cpp Twine.cpp Unicode.cpp - WindowsManifestMerger.cpp YAMLParser.cpp YAMLTraits.cpp raw_os_ostream.cpp diff --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt new file mode 100644 index 0000000000000..0bf5f421c18b7 --- /dev/null +++ b/llvm/lib/WindowsManifest/CMakeLists.txt @@ -0,0 +1,18 @@ +set(system_libs) +if( CMAKE_HOST_UNIX ) + if( LLVM_LIBXML2_ENABLED ) + set(system_libs ${system_libs} ${LIBXML2_LIBS}) + endif() +endif() + +add_llvm_library(LLVMWindowsManifest + WindowsManifestMerger.cpp + + ADDITIONAL_HEADER_DIRS + ${LLVM_MAIN_INCLUDE_DIR}/llvm/WindowsManifest + ${Backtrace_INCLUDE_DIRS} + + LINK_LIBS ${system_libs} + ) + +set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS "${system_libs}") diff --git a/llvm/lib/WindowsManifest/LLVMBuild.txt b/llvm/lib/WindowsManifest/LLVMBuild.txt new file mode 100644 index 0000000000000..d5de0275b66b1 --- /dev/null +++ b/llvm/lib/WindowsManifest/LLVMBuild.txt @@ -0,0 +1,22 @@ +;===- ./lib/WindowsManifest/LLVMBuild.txt ----------------------*- Conf -*--===; +; +; The LLVM Compiler Infrastructure +; +; This file is distributed under the University of Illinois Open Source +; License. See LICENSE.TXT for details. +; +;===------------------------------------------------------------------------===; +; +; This is an LLVMBuild description file for the components in this subdirectory. +; +; For more information on the LLVMBuild system, please see: +; +; http://llvm.org/docs/LLVMBuild.html +; +;===------------------------------------------------------------------------===; + +[component_0] +type = Library +name = WindowsManifest +parent = Libraries +required_libraries = Support diff --git a/llvm/lib/Support/WindowsManifestMerger.cpp b/llvm/lib/WindowsManifest/WindowsManifestMerger.cpp similarity index 99% rename from llvm/lib/Support/WindowsManifestMerger.cpp rename to llvm/lib/WindowsManifest/WindowsManifestMerger.cpp index 59c8a3af42eba..0c9e7fda5795a 100644 --- a/llvm/lib/Support/WindowsManifestMerger.cpp +++ b/llvm/lib/WindowsManifest/WindowsManifestMerger.cpp @@ -11,7 +11,7 @@ // //===---------------------------------------------------------------------===// -#include "llvm/Support/WindowsManifestMerger.h" +#include "llvm/WindowsManifest/WindowsManifestMerger.h" #include "llvm/Support/MemoryBuffer.h" #include diff --git a/llvm/tools/llvm-mt/CMakeLists.txt b/llvm/tools/llvm-mt/CMakeLists.txt index d97cc4fe446fa..e4e9946809214 100644 --- a/llvm/tools/llvm-mt/CMakeLists.txt +++ b/llvm/tools/llvm-mt/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS Option Support + WindowsManifest ) set(LLVM_TARGET_DEFINITIONS Opts.td) diff --git a/llvm/tools/llvm-mt/LLVMBuild.txt b/llvm/tools/llvm-mt/LLVMBuild.txt index 894d3527924ba..02fc9ace75521 100644 --- a/llvm/tools/llvm-mt/LLVMBuild.txt +++ b/llvm/tools/llvm-mt/LLVMBuild.txt @@ -19,4 +19,4 @@ type = Tool name = llvm-mt parent = Tools -required_libraries = Option Support +required_libraries = Option Support WindowsManifest diff --git a/llvm/tools/llvm-mt/llvm-mt.cpp b/llvm/tools/llvm-mt/llvm-mt.cpp index eca83b379fbbf..69af6a61c484f 100644 --- a/llvm/tools/llvm-mt/llvm-mt.cpp +++ b/llvm/tools/llvm-mt/llvm-mt.cpp @@ -22,8 +22,8 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Process.h" #include "llvm/Support/Signals.h" -#include "llvm/Support/WindowsManifestMerger.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/WindowsManifest/WindowsManifestMerger.h" #include