3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-25 19:36:21 +00:00

Migrate build system to CMake

See #5895 for details.

This commit does not include CI or documentation changes.
This commit is contained in:
Catherine 2026-05-12 05:33:04 +00:00
parent 9d0cdb8551
commit 9b087b4aa7
207 changed files with 5202 additions and 2294 deletions

25
tests/unit/CMakeLists.txt Normal file
View file

@ -0,0 +1,25 @@
include(CTest)
include(GoogleTest)
function(yosys_gtest arg_TARGET)
cmake_parse_arguments(PARSE_ARGV 1 arg "" "" "COMPONENTS")
set(arg_SOURCES ${arg_UNPARSED_ARGUMENTS})
set(target "gtest-${arg_TARGET}")
add_executable(${target} ${arg_SOURCES})
target_link_libraries(${target} PRIVATE GTest::gmock_main yosys_common)
yosys_expand_components(test_components essentials ${arg_COMPONENTS})
yosys_link_components(${target} PRIVATE ${test_components})
if(NOT CMAKE_CROSSCOMPILING)
gtest_discover_tests(${target})
endif()
endfunction()
if (GTest_FOUND)
add_subdirectory(kernel)
add_subdirectory(opt)
add_subdirectory(techmap)
enable_testing()
endif()

View file

@ -0,0 +1,14 @@
yosys_gtest(kernel
bitpatternTest.cc
cellTypesTest.cc
hashTest.cc
ioTest.cc
logTest.cc
modindexTest.cc
rtlilHelpers.h
rtlilStringTest.cc
rtlilTest.cc
sigspecExtractTest.cc
sigspecRemove2Test.cc
threadingTest.cc
)

View file

@ -0,0 +1,5 @@
yosys_gtest(opt
optDffFindComplementaryPatternTest.cc
COMPONENTS
opt_dff
)

View file

@ -0,0 +1,5 @@
yosys_gtest(techmap
libparseTest.cc
COMPONENTS
libparse
)