[pkg-d-commits] [ldc] 175/211: Make installation of the LTO plugin optional. Default to false on Linux where packaging the plugin does not always work properly (things are bad when the plugin is dynamically linked to LLVM, and the plugin ABI also depends on a system header file). Default to true on Mac (safe afaict).

Matthias Klumpp mak at moszumanska.debian.org
Sun Apr 23 22:36:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

mak pushed a commit to annotated tag v1.1.0
in repository ldc.

commit 2f987d16a69a537f4689499d5063a23eb7a3f8b7
Author: Johan Engelen <jbc.engelen at gmail.com>
Date:   Tue Nov 29 22:06:34 2016 +0100

    Make installation of the LTO plugin optional.
    Default to false on Linux where packaging the plugin does not always work properly (things are bad when the plugin is dynamically linked to LLVM, and the plugin ABI also depends on a system header file).
    Default to true on Mac (safe afaict).
---
 CMakeLists.txt | 30 +++++++++++++++++++-----------
 circle.yml     |  2 +-
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2387e11..d4b0270 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -676,19 +676,27 @@ build_d_executable(
 )
 
 #
-# Locate LLVM's LTO binary and use it
+# Locate LLVM's LTO binary and use it (LLVM >= 3.9)
 #
 if(APPLE)
-    set(LLVM_LTO_BINARY ${LLVM_LIBRARY_DIRS}/libLTO.dylib)
-    set(LDC_LTO_BINARY_NAME libLTO-ldc.dylib)
-elseif(UNIX)
-    set(LLVM_LTO_BINARY ${LLVM_LIBRARY_DIRS}/LLVMgold.so)
-    set(LDC_LTO_BINARY_NAME LLVMgold-ldc.so)
-endif()
-if(EXISTS ${LLVM_LTO_BINARY})
-    message(STATUS "Also installing LTO binary: ${LLVM_LTO_BINARY}")
-    file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
-    configure_file(${LLVM_LTO_BINARY} ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}/${LDC_LTO_BINARY_NAME} COPYONLY)
+    set(LDC_INSTALL_LTOPLUGIN_DEFAULT ON)
+else()
+    set(LDC_INSTALL_LTOPLUGIN_DEFAULT OFF)
+endif()
+set(LDC_INSTALL_LTOPLUGIN ${LDC_INSTALL_LTOPLUGIN_DEFAULT} CACHE BOOL "Copy/install the LTO plugin from the LLVM package when available (LLVM >= 3.9).")
+if (NOT (LDC_LLVM_VER LESS 309) AND LDC_INSTALL_LTOPLUGIN)
+    if(APPLE)
+        set(LLVM_LTO_BINARY ${LLVM_LIBRARY_DIRS}/libLTO.dylib)
+        set(LDC_LTO_BINARY_NAME libLTO-ldc.dylib)
+    elseif(UNIX)
+        set(LLVM_LTO_BINARY ${LLVM_LIBRARY_DIRS}/LLVMgold.so)
+        set(LDC_LTO_BINARY_NAME LLVMgold-ldc.so)
+    endif()
+    if(EXISTS ${LLVM_LTO_BINARY})
+        message(STATUS "Also installing LTO binary: ${LLVM_LTO_BINARY}")
+        file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX})
+        configure_file(${LLVM_LTO_BINARY} ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}/${LDC_LTO_BINARY_NAME} COPYONLY)
+    endif()
 endif()
 
 #
diff --git a/circle.yml b/circle.yml
index cabe3a1..d890e45 100644
--- a/circle.yml
+++ b/circle.yml
@@ -55,7 +55,7 @@ test:
     - cd build && export CC=clang && export CXX=clang++ && cmake .. && make -j3 && bin/ldc2 -version || exit 1
 
     # Now build LDC with itself and use this second build for further testing
-    - CC=clang CXX=clang++ cmake -DD_COMPILER="build/bin/ldmd2" .
+    - CC=clang CXX=clang++ cmake -DD_COMPILER="build/bin/ldmd2" -DLDC_INSTALL_LTOPLUGIN=ON .
     - make -j3
     - bin/ldc2 -version || exit 1
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git



More information about the pkg-d-commits mailing list