Index: llvm/cmake/modules/AddLLVM.cmake =================================================================== --- llvm/cmake/modules/AddLLVM.cmake +++ llvm/cmake/modules/AddLLVM.cmake @@ -1610,6 +1610,11 @@ endif() endif() + set(LLVM_UNITTEST_LINK_FLAGS "" CACHE STRING + "Additional linker flags for unit tests") + set_property(TARGET ${test_name} APPEND_STRING PROPERTY + LINK_FLAGS " ${LLVM_UNITTEST_LINK_FLAGS}") + set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}) set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir}) # libpthreads overrides some standard library symbols, so main