diff --git a/llvm/tools/gold/CMakeLists.txt b/llvm/tools/gold/CMakeLists.txt --- a/llvm/tools/gold/CMakeLists.txt +++ b/llvm/tools/gold/CMakeLists.txt @@ -3,6 +3,12 @@ if( LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR ) include_directories( ${LLVM_BINUTILS_INCDIR} ) + find_path(PLUGIN_API_H plugin-api.h ${LLVM_BINUTILS_INCDIR}) + if (NOT PLUGIN_API_H) + message(FATAL_ERROR "Can't find plugin-api.h in ${LLVM_BINUTILS_INCDIR}. " + "Make sure you have GNU binutils header files installed there.") + endif() + set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} Linker