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 @@ -492,10 +492,13 @@ # 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") + # Mirror the private and interface include directories from the original + # target. + set_target_properties(${obj_name} PROPERTIES + INCLUDE_DIRECTORIES "$" + INTERFACE_INCLUDE_DIRECTORIES "$" + FOLDER "Object Libraries" + ) if(ARG_DEPENDS) add_dependencies(${obj_name} ${ARG_DEPENDS}) endif() @@ -812,6 +815,11 @@ llvm_add_library(${name} ${ARG_UNPARSED_ARGUMENTS}) endif() + target_include_directories(${name} PUBLIC + $ + $ + ) + # Libraries that are meant to only be exposed via the build tree only are # never installed and are only exported as a target in the special build tree # config file. @@ -1850,7 +1858,7 @@ function(add_lit_testsuites project directory) if (NOT LLVM_ENABLE_IDE) cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "FOLDER" "PARAMS;DEPENDS;ARGS" ${ARGN}) - + if (NOT ARG_FOLDER) set(ARG_FOLDER "Test Subdirectories") endif() diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake --- a/mlir/cmake/modules/AddMLIR.cmake +++ b/mlir/cmake/modules/AddMLIR.cmake @@ -145,7 +145,15 @@ endforeach() list(APPEND ARG_DEPENDS mlir-generic-headers) - llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs} DEPENDS ${ARG_DEPENDS} LINK_COMPONENTS ${ARG_LINK_COMPONENTS} LINK_LIBS ${ARG_LINK_LIBS}) + llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs} + DEPENDS ${ARG_DEPENDS} + LINK_COMPONENTS ${ARG_LINK_COMPONENTS} + LINK_LIBS ${ARG_LINK_LIBS}) + + target_include_directories(${name} PUBLIC + $ + $ + ) if(TARGET ${name}) target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})