Use system libs when available

This commit is contained in:
Miodrag Milanovic 2026-07-13 15:26:00 +02:00
parent 0e82bbefe5
commit 30ba4328e7
4 changed files with 39 additions and 23 deletions

View File

@ -6,6 +6,8 @@ add_subdirectory(json)
add_subdirectory(liberty) add_subdirectory(liberty)
add_subdirectory(rpc) add_subdirectory(rpc)
add_subdirectory(rtlil) add_subdirectory(rtlil)
if (NOT YOSYS_WITHOUT_SLANG)
add_subdirectory(slang) add_subdirectory(slang)
endif()
add_subdirectory(verific) add_subdirectory(verific)
add_subdirectory(verilog) add_subdirectory(verilog)

View File

@ -35,5 +35,4 @@ yosys_frontend(slang
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
LIBRARIES LIBRARIES
$<${YOSYS_ENABLE_SLANG}:slang::slang> $<${YOSYS_ENABLE_SLANG}:slang::slang>
fmt::fmt
) )

View File

@ -12,6 +12,10 @@ block()
include(FetchContent) include(FetchContent)
set(FETCHCONTENT_FULLY_DISCONNECTED ON) set(FETCHCONTENT_FULLY_DISCONNECTED ON)
find_package(fmt 12.2 QUIET)
if(fmt_FOUND)
set(SLANG_USE_SYSTEM_FMT ON)
else()
option(FMT_INSTALL OFF) option(FMT_INSTALL OFF)
FetchContent_Declare( FetchContent_Declare(
fmt fmt
@ -19,14 +23,24 @@ block()
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/fmt SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/fmt
) )
FetchContent_MakeAvailable(fmt) FetchContent_MakeAvailable(fmt)
endif()
find_package(tomlplusplus 3.4 QUIET)
if(tomlplusplus_FOUND)
set(SLANG_USE_SYSTEM_TOMLPLUSPLUS ON)
else()
FetchContent_Declare( FetchContent_Declare(
tomlplusplus tomlplusplus
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tomlplusplus SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tomlplusplus
) )
FetchContent_MakeAvailable(tomlplusplus) FetchContent_MakeAvailable(tomlplusplus)
endif()
find_package(Boost 1.87.0 CONFIG QUIET)
if(Boost_FOUND)
set(SLANG_USE_SYSTEM_BOOST ON)
else()
FetchContent_Declare( FetchContent_Declare(
boost_regex boost_regex
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
@ -34,6 +48,7 @@ block()
SOURCE_SUBDIR _no_build_ SOURCE_SUBDIR _no_build_
) )
FetchContent_MakeAvailable(boost_regex) FetchContent_MakeAvailable(boost_regex)
endif()
if (NOT YOSYS_WITHOUT_SLANG) if (NOT YOSYS_WITHOUT_SLANG)
set(SLANG_USE_MIMALLOC OFF) set(SLANG_USE_MIMALLOC OFF)

@ -1 +1 @@
Subproject commit 6175750969f17289695f94be5105f6006c82eb61 Subproject commit 8acc660a20b70de48ecec1c7471863e6f4b3ae6f