Skip to content

Commit

Permalink
[CMake] Fix install failure with CMAKE_SLANG_FRONTEND_ENABLED enabled (
Browse files Browse the repository at this point in the history
…#7437)

Slang compiler relies on the third-party libraries like unordered_dense and fmt
library. The fmt library provides two ways to integrated it:
  1.Headers-only
  2.Seperately compiled
The main purpose of this commit is to avoid installation failure of CIRCT project due
to finding fmt header file in wrong path which is in circt `include` directory when
CMake_slang_Frontend_enabled is turned on. We hope to not install header files coming
from fmt library.
  • Loading branch information
cepheus69 authored Aug 6, 2024
1 parent b35bc81 commit 930aabe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,13 @@ if(CIRCT_SLANG_FRONTEND_ENABLED)
# harder than it ought to be.
set_property(
GLOBAL APPEND PROPERTY CIRCT_EXPORTS slang_slang unordered_dense fmt)

# Disable the installation of headers coming from third-party libraries. We
# won't use those APIs directly. Just make them static libraries for the sake
# of running slang normally.
set_target_properties(fmt PROPERTIES PUBLIC_HEADER "")
set_target_properties(unordered_dense PROPERTIES PUBLIC_HEADER "")

install(TARGETS slang_slang unordered_dense fmt EXPORT CIRCTTargets)
else()
find_package(slang 3.0 REQUIRED)
Expand Down

0 comments on commit 930aabe

Please sign in to comment.