Index: tools/llvm-cfi-verify/lib/CMakeLists.txt =================================================================== --- tools/llvm-cfi-verify/lib/CMakeLists.txt +++ tools/llvm-cfi-verify/lib/CMakeLists.txt @@ -1,9 +1,14 @@ -add_llvm_library(LLVMCFIVerify - FileAnalysis.cpp - FileAnalysis.h - - LINK_COMPONENTS +set(LLVM_LINK_COMPONENTS MC MCParser Object Support) + +add_library(LLVMCFIVerify + STATIC + FileAnalysis.cpp + FileAnalysis.h) + +llvm_update_compile_flags(LLVMCFIVerify) +llvm_map_components_to_libnames(libs ${LLVM_LINK_COMPONENTS}) +target_link_libraries(LLVMCFIVerify ${libs}) Index: unittests/tools/llvm-cfi-verify/CMakeLists.txt =================================================================== --- unittests/tools/llvm-cfi-verify/CMakeLists.txt +++ unittests/tools/llvm-cfi-verify/CMakeLists.txt @@ -4,7 +4,6 @@ AllTargetsDescs AllTargetsDisassemblers AllTargetsInfos - CFIVerify MC MCParser Object @@ -15,4 +14,6 @@ if (NOT x86_idx LESS 0) add_llvm_unittest(CFIVerifyTests FileAnalysis.cpp) + target_link_libraries(CFIVerifyTests LLVMCFIVerify) + export_executable_symbols(CFIVerifyTests) endif()