diff --git a/CMakeLists.txt b/CMakeLists.txt index 3745ea0fe..bccf29049 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -535,6 +535,7 @@ if (NOT YOSYS_BUILD_PYTHON_ONLY) add_custom_target(test-unit COMMAND ${CMAKE_CTEST_COMMAND} --test-dir tests/unit --output-on-failure WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + DEPENDS $<$:yosys-gtest-all> ) add_custom_target(test-vanilla diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index cc326d2d3..8534964a6 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -14,6 +14,7 @@ function(yosys_gtest arg_TARGET) ) yosys_expand_components(test_components essentials ${arg_COMPONENTS}) yosys_link_components(${target} PRIVATE ${test_components}) + add_dependencies(yosys-gtest-all ${target}) if(NOT CMAKE_CROSSCOMPILING) gtest_discover_tests(${target}) @@ -21,6 +22,8 @@ function(yosys_gtest arg_TARGET) endfunction() if (GTest_FOUND) + add_custom_target(yosys-gtest-all) + add_subdirectory(kernel) add_subdirectory(opt) add_subdirectory(techmap)