mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-25 11:26:22 +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:
parent
9d0cdb8551
commit
9b087b4aa7
207 changed files with 5202 additions and 2294 deletions
25
tests/unit/CMakeLists.txt
Normal file
25
tests/unit/CMakeLists.txt
Normal 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()
|
||||
14
tests/unit/kernel/CMakeLists.txt
Normal file
14
tests/unit/kernel/CMakeLists.txt
Normal 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
|
||||
)
|
||||
5
tests/unit/opt/CMakeLists.txt
Normal file
5
tests/unit/opt/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
yosys_gtest(opt
|
||||
optDffFindComplementaryPatternTest.cc
|
||||
COMPONENTS
|
||||
opt_dff
|
||||
)
|
||||
5
tests/unit/techmap/CMakeLists.txt
Normal file
5
tests/unit/techmap/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
yosys_gtest(techmap
|
||||
libparseTest.cc
|
||||
COMPONENTS
|
||||
libparse
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue