aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-07-12 15:05:49 -0700
committerGitHub <noreply@github.com>2017-07-12 15:05:49 -0700
commit5f96610af9943ca5d6648a655e110ec08776941d (patch)
treed9ec9d82ad654d5b4f0aed4a9b8922909c56ef07
parente2fe95357895fad126df916d786e05ab3b526472 (diff)
parentaea2734ad4c7fbe04bd5f35844aa72e4300d74fb (diff)
downloadvcpkg-5f96610af9943ca5d6648a655e110ec08776941d.tar.gz
vcpkg-5f96610af9943ca5d6648a655e110ec08776941d.zip
Merge pull request #1388 from dada2048/add-llvm
Addition of LLVM.
-rw-r--r--ports/llvm/CONTROL3
-rw-r--r--ports/llvm/install-cmake-modules-to-share.patch10
-rw-r--r--ports/llvm/portfile.cmake45
3 files changed, 58 insertions, 0 deletions
diff --git a/ports/llvm/CONTROL b/ports/llvm/CONTROL
new file mode 100644
index 000000000..9b7936004
--- /dev/null
+++ b/ports/llvm/CONTROL
@@ -0,0 +1,3 @@
+Source: llvm
+Version: 4.0.0
+Description: The LLVM Compiler Infrastructure
diff --git a/ports/llvm/install-cmake-modules-to-share.patch b/ports/llvm/install-cmake-modules-to-share.patch
new file mode 100644
index 000000000..b5193beca
--- /dev/null
+++ b/ports/llvm/install-cmake-modules-to-share.patch
@@ -0,0 +1,10 @@
+diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
+index ac4b0b7..13a271d 100644
+--- a/cmake/modules/CMakeLists.txt
++++ b/cmake/modules/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
++set(LLVM_INSTALL_PACKAGE_DIR share/llvm)
+ set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
+
+ # First for users who use an installed LLVM, create the LLVMExports.cmake file.
diff --git a/ports/llvm/portfile.cmake b/ports/llvm/portfile.cmake
new file mode 100644
index 000000000..9edf7f2b1
--- /dev/null
+++ b/ports/llvm/portfile.cmake
@@ -0,0 +1,45 @@
+# LLVM documentation recommends always using static library linkage when
+# building with Microsoft toolchain; it's also the default on other platforms
+set(VCPKG_LIBRARY_LINKAGE static)
+
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/llvm-4.0.0.src)
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://releases.llvm.org/4.0.0/llvm-4.0.0.src.tar.xz"
+ FILENAME "llvm-4.0.0.src.tar.xz"
+ SHA512 cf681f0626ef6d568d951cdc3e143471a1d7715a0ba11e52aa273cf5d8d421e1357ef2645cc85879eaefcd577e99e74d07b01566825b3d0461171ef2cbfc7704
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/install-cmake-modules-to-share.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DLLVM_TARGETS_TO_BUILD=X86
+ -DLLVM_INCLUDE_TOOLS=OFF
+ -DLLVM_INCLUDE_UTILS=OFF
+ -DLLVM_INCLUDE_EXAMPLES=OFF
+ -DLLVM_INCLUDE_TESTS=OFF
+ -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
+ -DLLVM_TOOLS_INSTALL_DIR=tools
+)
+
+vcpkg_install_cmake()
+
+# Remove extra copy of cmake modules and include files
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Remove one empty include subdirectory if it is indeed empty
+file(GLOB MCANALYSISFILES ${CURRENT_PACKAGES_DIR}/include/llvm/MC/MCAnalysis/*)
+if(NOT MCANALYSISFILES)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/llvm/MC/MCAnalysis)
+endif()
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/llvm RENAME copyright)