Move the LTO plugin to the bin dir.

This commit is contained in:
Johan Engelen 2016-11-27 19:34:08 +01:00
parent d4f5b8ab6c
commit 23a677d001
2 changed files with 4 additions and 5 deletions

View file

@ -736,9 +736,8 @@ elseif(UNIX)
endif() endif()
if(EXISTS ${LLVM_LTO_BINARY}) if(EXISTS ${LLVM_LTO_BINARY})
message(STATUS "Also installing LTO binary: ${LLVM_LTO_BINARY}") message(STATUS "Also installing LTO binary: ${LLVM_LTO_BINARY}")
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/lib) configure_file(${LLVM_LTO_BINARY} ${PROJECT_BINARY_DIR}/bin/${LDC_LTO_BINARY_NAME} COPYONLY)
configure_file(${LLVM_LTO_BINARY} ${PROJECT_BINARY_DIR}/lib/${LDC_LTO_BINARY_NAME} COPYONLY) install(PROGRAMS ${PROJECT_BINARY_DIR}/bin/${LDC_LTO_BINARY_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(PROGRAMS ${PROJECT_BINARY_DIR}/lib/${LDC_LTO_BINARY_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
endif() endif()
# #

View file

@ -130,7 +130,7 @@ std::string getLTOGoldPluginPath() {
} else { } else {
std::string searchPaths[] = { std::string searchPaths[] = {
// The plugin packaged with LDC has a "-ldc" suffix. // The plugin packaged with LDC has a "-ldc" suffix.
exe_path::prependLibDir("LLVMgold-ldc.so"), exe_path::prependBinDir("LLVMgold-ldc.so"),
"/usr/local/lib/LLVMgold.so", "/usr/lib/bfd-plugins/LLVMgold.so", "/usr/local/lib/LLVMgold.so", "/usr/lib/bfd-plugins/LLVMgold.so",
}; };
@ -181,7 +181,7 @@ std::string getLTOdylibPath() {
fatal(); fatal();
} else { } else {
// The plugin packaged with LDC has a "-ldc" suffix. // The plugin packaged with LDC has a "-ldc" suffix.
std::string searchPath = exe_path::prependLibDir("libLTO-ldc.dylib"); std::string searchPath = exe_path::prependBinDir("libLTO-ldc.dylib");
if (llvm::sys::fs::exists(searchPath)) if (llvm::sys::fs::exists(searchPath))
return searchPath; return searchPath;