Skip to content

Commit

Permalink
[CMake] Add CMake targets to install all CIRCT libraries. (llvm#6798)
Browse files Browse the repository at this point in the history
These targets are useful for downstream projects that want to install
all CIRCT libraries. The CMake commands follow how similar targets are
set up in upstream MLIR.
  • Loading branch information
mikeurbach authored Mar 8, 2024
1 parent 1cc1069 commit 1abb2c6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,29 @@ if (NOT LLVM_ENABLE_IDE)
COMPONENT circt-headers)
endif()


# Custom target to install all CIRCT libraries
add_custom_target(circt-libraries)
set_target_properties(circt-libraries PROPERTIES FOLDER "Misc")

if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-circt-libraries
DEPENDS circt-libraries
COMPONENT circt-libraries)
endif()

get_property(CIRCT_LIBS GLOBAL PROPERTY CIRCT_ALL_LIBS)
if(CIRCT_LIBS)
list(REMOVE_DUPLICATES CIRCT_LIBS)
foreach(lib ${CIRCT_LIBS})
add_dependencies(circt-libraries ${lib})
if(NOT LLVM_ENABLE_IDE)
add_dependencies(install-circt-libraries install-${lib})
add_dependencies(install-circt-libraries-stripped install-${lib}-stripped)
endif()
endforeach()
endif()

add_subdirectory(cmake/modules)

# Set RPATH to $ORIGIN on all targets.
Expand Down

0 comments on commit 1abb2c6

Please sign in to comment.