From 841852327e532a7750bed8904ce48437c8366f40 Mon Sep 17 00:00:00 2001 From: Christian Lehmann Date: Mon, 18 Nov 2024 14:56:07 +0100 Subject: [PATCH 1/2] build unit_test static only, cleanup --- CMakeLists.txt | 5 +- test/vvenc_unit_test/CMakeLists.txt | 18 ++- test/vvenc_unit_test/resource.h | 61 ++++++++++ test/vvenc_unit_test/resource_version.h | 52 ++++++++ test/vvenc_unit_test/vvenc_unit_test.rc | 153 ++++++++++++++++++++++++ 5 files changed, 284 insertions(+), 5 deletions(-) create mode 100644 test/vvenc_unit_test/resource.h create mode 100644 test/vvenc_unit_test/resource_version.h create mode 100644 test/vvenc_unit_test/vvenc_unit_test.rc diff --git a/CMakeLists.txt b/CMakeLists.txt index d0fadfe70..62eba9b0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -382,7 +382,10 @@ add_subdirectory( "source/App/vvencapp" ) add_subdirectory( "source/App/vvencFFapp" ) add_subdirectory( "test/vvenclibtest" ) add_subdirectory( "test/vvencinterfacetest" ) -add_subdirectory( "test/vvenc_unit_test" ) + +if( NOT BUILD_SHARED_LIBS ) + add_subdirectory( "test/vvenc_unit_test" ) +endif() include( cmake/modules/vvencTests.cmake ) diff --git a/test/vvenc_unit_test/CMakeLists.txt b/test/vvenc_unit_test/CMakeLists.txt index 0df22f510..b3c3e7ce7 100644 --- a/test/vvenc_unit_test/CMakeLists.txt +++ b/test/vvenc_unit_test/CMakeLists.txt @@ -1,9 +1,18 @@ +# executable set( EXE_NAME vvenc_unit_test ) +# get source files file( GLOB SRC_FILES CONFIGURE_DEPENDS "*.cpp" ) +# get include files file( GLOB INC_FILES CONFIGURE_DEPENDS "*.h" ) -add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ) +# set resource file for MSVC compilers +if( MSVC ) + set( RESOURCE_FILE ${EXE_NAME}.rc ) +endif() + +# add executable +add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${RESOURCE_FILE} ) set_target_properties( ${EXE_NAME} PROPERTIES RELEASE_POSTFIX "${CMAKE_RELEASE_POSTFIX}" ) set_target_properties( ${EXE_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}" ) set_target_properties( ${EXE_NAME} PROPERTIES RELWITHDEBINFO_POSTFIX "${CMAKE_RELWITHDEBINFO_POSTFIX}" ) @@ -19,9 +28,10 @@ target_compile_options( ${EXE_NAME} PRIVATE $<$,$ Date: Mon, 18 Nov 2024 15:08:59 +0100 Subject: [PATCH 2/2] cleanup --- test/vvenc_unit_test/resource.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/vvenc_unit_test/resource.h b/test/vvenc_unit_test/resource.h index 2f5e5c5fa..c5517c1ea 100644 --- a/test/vvenc_unit_test/resource.h +++ b/test/vvenc_unit_test/resource.h @@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE. //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by vvenclibtest.rc +// Used by vvenc_unit_test.rc // Next default values for new objects //