Skip to content

Commit

Permalink
Move manifest utils into separate lib, to reduce libxml2 deps.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Eric Beckmann committed Jul 26, 2017
1 parent 037bcd9 commit 36be14c
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 7 deletions.
6 changes: 6 additions & 0 deletions llvm/include/llvm/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,9 @@ module LLVM_Support_DataTypes_Src {
header "llvm/Support/DataTypes.h"
export *
}

module LLVM_WindowsManifest {
requires cplusplus
umbrella "WindowsManifest"
module * { export * }
}
1 change: 1 addition & 0 deletions llvm/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ add_subdirectory(Passes)
add_subdirectory(ToolDrivers)
add_subdirectory(XRay)
add_subdirectory(Testing)
add_subdirectory(WindowsManifest)
1 change: 1 addition & 0 deletions llvm/lib/LLVMBuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ subdirectories =
Testing
ToolDrivers
Transforms
WindowsManifest

[component_0]
type = Group
Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -113,7 +110,6 @@ add_llvm_library(LLVMSupport
Triple.cpp
Twine.cpp
Unicode.cpp
WindowsManifestMerger.cpp
YAMLParser.cpp
YAMLTraits.cpp
raw_os_ostream.cpp
Expand Down
18 changes: 18 additions & 0 deletions llvm/lib/WindowsManifest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}")
22 changes: 22 additions & 0 deletions llvm/lib/WindowsManifest/LLVMBuild.txt
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
//===---------------------------------------------------------------------===//

#include "llvm/Support/WindowsManifestMerger.h"
#include "llvm/WindowsManifest/WindowsManifestMerger.h"
#include "llvm/Support/MemoryBuffer.h"

#include <stdarg.h>
Expand Down
1 change: 1 addition & 0 deletions llvm/tools/llvm-mt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(LLVM_LINK_COMPONENTS
Option
Support
WindowsManifest
)

set(LLVM_TARGET_DEFINITIONS Opts.td)
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-mt/LLVMBuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
type = Tool
name = llvm-mt
parent = Tools
required_libraries = Option Support
required_libraries = Option Support WindowsManifest
2 changes: 1 addition & 1 deletion llvm/tools/llvm-mt/llvm-mt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <system_error>

Expand Down

0 comments on commit 36be14c

Please sign in to comment.