3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-14 03:05:41 +00:00

Merge pull request #6034 from YosysHQ/mmicko/system_libs

cmake: Use system libs when available
This commit is contained in:
Miodrag Milanović 2026-07-13 15:50:10 +00:00 committed by GitHub
commit 22c15a7ecd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 48 additions and 24 deletions

View file

@ -93,7 +93,7 @@ jobs:
shell: bash
run: |
rm -rf build
cmake -B build . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DYOSYS_COMPILER_LAUNCHER=ccache
cmake -B build . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DYOSYS_COMPILER_LAUNCHER=ccache -DYOSYS_USE_BUNDLED_LIBS=ON
cmake --build build -j$procs
ctest --test-dir build/tests/unit

View file

@ -57,6 +57,8 @@ option(YOSYS_WITHOUT_SLANG "Disable Slang integration" OFF)
option(YOSYS_WITHOUT_TCL "Disable Tcl integration" OFF)
option(YOSYS_WITH_PYTHON "Enable Python integration" OFF)
option(YOSYS_USE_BUNDLED_LIBS "Use bundled third-party libraries" OFF)
set(YOSYS_VERIFIC_DIR "" CACHE FILEPATH "Path to the Verific source code (empty to disable)")
set(YOSYS_VERIFIC_COMPONENTS "" CACHE STRING
"List of Verific components to link (empty for autodetect)")

View file

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

View file

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

View file

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

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