Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flang/cmake/modules/AddFlang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function(add_flang_library name)
ADDITIONAL_HEADERS
${srcs}
${ARG_ADDITIONAL_HEADERS}) # It may contain unparsed unknown args.

endif()

if(ARG_SHARED AND ARG_STATIC)
Expand All @@ -75,7 +75,7 @@ function(add_flang_library name)

if (TARGET ${name})

if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libflang"
if ((NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND NOT MLIR_INSTALL_TOOLCHAIN_ONLY) OR ${name} STREQUAL "libflang"
OR ARG_INSTALL_WITH_TOOLCHAIN)
get_target_export_arg(${name} Flang export_to_flangtargets UMBRELLA flang-libraries)
install(TARGETS ${name}
Expand Down
1 change: 1 addition & 0 deletions mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ endif()

set(MLIR_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
"Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
option(MLIR_INSTALL_TOOLCHAIN_ONLY "Do not install MLIR libraries unless they belong to the toolchain" OFF)
mark_as_advanced(MLIR_TOOLS_INSTALL_DIR)

set(MLIR_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
Expand Down
7 changes: 6 additions & 1 deletion mlir/cmake/modules/AddMLIR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include(TableGen)
include(GNUInstallDirs)
include(LLVMDistributionSupport)


function(mlir_tablegen ofn)
tablegen(MLIR ${ARGV})
set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
Expand Down Expand Up @@ -632,8 +633,12 @@ endfunction(add_mlir_aggregate)
# This is usually done as part of add_mlir_library but is broken out for cases
# where non-standard library builds can be installed.
function(add_mlir_library_install name)
message("add_mlir_library_install(${name})")
message("MLIR_INSTALL_TOOLCHAIN_ONLY: ${MLIR_INSTALL_TOOLCHAIN_ONLY}")
message("LLVM_INSTALL_TOOLCHAIN_ONLY: ${LLVM_INSTALL_TOOLCHAIN_ONLY}")
get_target_property(_install_with_toolchain ${name} MLIR_INSTALL_WITH_TOOLCHAIN)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR _install_with_toolchain)
if ((NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND NOT MLIR_INSTALL_TOOLCHAIN_ONLY) OR _install_with_toolchain)
message("installing ${name}")
get_target_export_arg(${name} MLIR export_to_mlirtargets UMBRELLA mlir-libraries)
install(TARGETS ${name}
COMPONENT ${name}
Expand Down