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) 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})