aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Lajoie <dada@typicus.org>2017-07-01 19:24:11 -0400
committerStephane Lajoie <dada@typicus.org>2017-07-01 19:24:11 -0400
commitf4e797920f7b0be50881469d018cd6f7d92dba82 (patch)
treeeb909ffe4d99dde53c38a2e41052c112718cd857
parent144d3718c4197b101c7d61ee6a258200371fb1ab (diff)
downloadvcpkg-f4e797920f7b0be50881469d018cd6f7d92dba82.tar.gz
vcpkg-f4e797920f7b0be50881469d018cd6f7d92dba82.zip
Added LLVM.
-rw-r--r--ports/llvm/CONTROL3
-rw-r--r--ports/llvm/portfile.cmake42
2 files changed, 45 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/portfile.cmake b/ports/llvm/portfile.cmake
new file mode 100644
index 000000000..a71c941ed
--- /dev/null
+++ b/ports/llvm/portfile.cmake
@@ -0,0 +1,42 @@
+# Common Ambient Variables:
+# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
+# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
+# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
+# PORT = current port name (zlib, etc)
+# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
+# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
+# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
+# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
+# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
+#
+
+# 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_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA # Disable this option if project cannot be built with Ninja
+ OPTIONS -DLLVM_BUILD_TOOLS=OFF
+ # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
+ # OPTIONS_RELEASE -DOPTIMIZE=1
+ # OPTIONS_DEBUG -DDEBUGGABLE=1
+)
+
+vcpkg_install_cmake()
+
+# Remove extra copies of include files in debug directory
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/llvm)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/llvm/LICENSE.TXT ${CURRENT_PACKAGES_DIR}/share/llvm/copyright)