diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -486,6 +486,9 @@ # Do add_dependencies(obj) later due to CMake issue 14747. list(APPEND objlibs ${obj_name}) + # Bring in the target include directories from our original target. + target_include_directories(${obj_name} PRIVATE $) + set_target_properties(${obj_name} PROPERTIES FOLDER "Object Libraries") if(ARG_DEPENDS) add_dependencies(${obj_name} ${ARG_DEPENDS}) @@ -525,6 +528,11 @@ LINK_LIBS ${ARG_LINK_LIBS} LINK_COMPONENTS ${ARG_LINK_COMPONENTS} ) + + # Bring in the target link info from our original target. + target_link_directories(${name_static} PRIVATE $) + target_link_libraries(${name_static} PRIVATE $) + # FIXME: Add name_static to anywhere in TARGET ${name}'s PROPERTY. set(ARG_STATIC) endif()