circt
circt copied to clipboard
[ESI][runtime] Make cmake-distributed header include-able
Currently, https://github.com/llvm/circt/blob/main/lib/Dialect/ESI/runtime/CMakeLists.txt is written in such a way that (i presume) it's expected to be added via add_subdirectory. Instead, I think it would be better to have an esi.cmake file which can be included, or write the CMake support s.t. we can do find_library.
As a minimum, this file needs to be refactored s.t. file-paths are absolute (using ${CMAKE_CURRENT_SORCE_DIR}) and not relative (e.g. set(ESIRuntimeSources cpp/lib/Accelerator.cpp ... -> set(ESIRuntimeSources ${CMAKE_CURRENT_SORCE_DIR}/cpp/lib/Accelerator.cpp).
Partially addressed by https://github.com/llvm/circt/commit/b51a6448d061f3deb48733348e7c0f5204e4cfcd and https://github.com/llvm/circt/commit/474fc3f4a4fc0d9327f9577da5a98ca2f3dd377b. ESI Runtime is now FetchContent-able. I also have a .cmake file which gets installed.