[PATCH] D16386: [GlobalISel] make library an optional component
Andrew Wilkins via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 20 17:33:57 PST 2016
axw created this revision.
axw added a reviewer: qcolombet.
axw added a subscriber: llvm-commits.
Herald added subscribers: vkalintiris, joker.eph.
Mark the LLVMGlobalISel library as optional in
LLVMBuild.txt, since the library is only built
if LLVM_BUILD_GLOBAL_ISEL is set. Without doing
this, llvm-config includes the library in the
list of components regardless of whether it's
built, and then will error out when asked for
the library names/paths.
http://reviews.llvm.org/D16386
Files:
cmake/modules/AddLLVM.cmake
lib/CodeGen/GlobalISel/LLVMBuild.txt
tools/llvm-go/CMakeLists.txt
Index: tools/llvm-go/CMakeLists.txt
===================================================================
--- tools/llvm-go/CMakeLists.txt
+++ tools/llvm-go/CMakeLists.txt
@@ -1,8 +1,11 @@
if(LLVM_BINDINGS MATCHES "go")
+ # FIXME: This should depend only on the libraries Go needs.
+ get_property(llvmlibs GLOBAL PROPERTY LLVM_LIBS)
set(binpath ${CMAKE_BINARY_DIR}/bin/llvm-go${CMAKE_EXECUTABLE_SUFFIX})
add_custom_command(OUTPUT ${binpath}
COMMAND ${GO_EXECUTABLE} build -o ${binpath} llvm-go.go
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/llvm-go.go
+ ${llvmlibs}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Building Go executable llvm-go")
add_custom_target(llvm-go ALL DEPENDS ${binpath})
Index: lib/CodeGen/GlobalISel/LLVMBuild.txt
===================================================================
--- lib/CodeGen/GlobalISel/LLVMBuild.txt
+++ lib/CodeGen/GlobalISel/LLVMBuild.txt
@@ -16,7 +16,7 @@
;===------------------------------------------------------------------------===;
[component_0]
-type = Library
+type = OptionalLibrary
name = GlobalISel
parent = CodeGen
required_libraries = Analysis CodeGen Core MC Support Target TransformUtils
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -902,8 +902,6 @@
cmake_parse_arguments(ARG "ALL" "" "DEPENDS;GOFLAGS" ${ARGN})
if(LLVM_BINDINGS MATCHES "go")
- # FIXME: This should depend only on the libraries Go needs.
- get_property(llvmlibs GLOBAL PROPERTY LLVM_LIBS)
set(binpath ${CMAKE_BINARY_DIR}/bin/${binary}${CMAKE_EXECUTABLE_SUFFIX})
set(cc "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
set(cxx "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}")
@@ -916,8 +914,7 @@
add_custom_command(OUTPUT ${binpath}
COMMAND ${CMAKE_BINARY_DIR}/bin/llvm-go "go=${GO_EXECUTABLE}" "cc=${cc}" "cxx=${cxx}" "cppflags=${cppflags}" "ldflags=${ldflags}"
${ARG_GOFLAGS} build -o ${binpath} ${pkgpath}
- DEPENDS llvm-config ${CMAKE_BINARY_DIR}/bin/llvm-go${CMAKE_EXECUTABLE_SUFFIX}
- ${llvmlibs} ${ARG_DEPENDS}
+ DEPENDS llvm-config ${CMAKE_BINARY_DIR}/bin/llvm-go${CMAKE_EXECUTABLE_SUFFIX} ${ARG_DEPENDS}
COMMENT "Building Go executable ${binary}"
VERBATIM)
if (ARG_ALL)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16386.45474.patch
Type: text/x-patch
Size: 2384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160121/f56f50a4/attachment.bin>
More information about the llvm-commits
mailing list