From 42763a903fe122bc203f3aa9bbe5a5f4754758a0 Mon Sep 17 00:00:00 2001 From: Daniel Bermond Date: Sat, 14 Dec 2024 19:19:08 -0300 Subject: [PATCH] Fix unit test execution when building in shared linking mode The unit test is built only when static linking, but the test itself was still being invoked when running 'ctest' in shared linking mode. This leads to the following test failure in 'ctest': 'Could not find executable vvenc_unit_test'. This adds a fix so the unit test is not run in shared builds. --- cmake/modules/vvencTests.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/modules/vvencTests.cmake b/cmake/modules/vvencTests.cmake index 1320b5a81..2ed986664 100644 --- a/cmake/modules/vvencTests.cmake +++ b/cmake/modules/vvencTests.cmake @@ -19,7 +19,9 @@ add_test( NAME Test_vvenclibtest-sdk_default COMMAND vvenclibtest 4 add_test( NAME Test_vvenclibtest-sdk_stringapi_interface COMMAND vvenclibtest 5 ) add_test( NAME Test_vvenclibtest-timestamps COMMAND vvenclibtest 6 ) -add_test( NAME Test_vvenc_unit_test COMMAND vvenc_unit_test ) +if( NOT BUILD_SHARED_LIBS ) + add_test( NAME Test_vvenc_unit_test COMMAND vvenc_unit_test ) +endif() set( CLEANUP_TEST_FILES "" )