From 65feb9ecd15f1fb2c73fc66bf3fa4d66bac8c5ee Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 30 Jan 2025 12:31:02 +0100 Subject: [PATCH] [cmake,tests] add BUILD_TESTING_NO_H264 allow disabling H264 unit tests for package builds. Some distributions do not ship full implementations for the package builders --- cmake/ConfigOptions.cmake | 3 +++ libfreerdp/codec/test/CMakeLists.txt | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index cf94704e1..a31a06a50 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -59,6 +59,9 @@ option(BUILD_TESTING "Build unit tests (compatible with packaging)" OFF) cmake_dependent_option( BUILD_TESTING_INTERNAL "Build unit tests (CI only, not for packaging!)" OFF "NOT BUILD_TESTING" OFF ) +cmake_dependent_option( + BUILD_TESTING_NO_H264 "Skip building h264 unit tests (no implementation during packaging)" OFF "BUILD_TESTING OR BUILD_TESTING_INTERNAL" OFF +) cmake_dependent_option(TESTS_WTSAPI_EXTRA "Build extra WTSAPI tests (interactive)" OFF "BUILD_TESTING_INTERNAL" OFF) cmake_dependent_option(BUILD_COMM_TESTS "Build comm related tests (require comm port)" OFF "BUILD_TESTING_INTERNAL" OFF) diff --git a/libfreerdp/codec/test/CMakeLists.txt b/libfreerdp/codec/test/CMakeLists.txt index 5f607e492..b9dddcaad 100644 --- a/libfreerdp/codec/test/CMakeLists.txt +++ b/libfreerdp/codec/test/CMakeLists.txt @@ -11,12 +11,17 @@ set(TESTS TestFreeRDPCodecPlanar.c TestFreeRDPCodecCopy.c TestFreeRDPCodecClear.c - TestFreeRDPCodecH264.c TestFreeRDPCodecInterleaved.c TestFreeRDPCodecProgressive.c TestFreeRDPCodecRemoteFX.c ) +if (NOT BUILD_TESTING_NO_H264) + list(APPEND TESTS + TestFreeRDPCodecH264.c + ) +endif() + if(BUILD_TESTING_INTERNAL) list(APPEND TESTS TestFreeRDPCodecMppc.c TestFreeRDPCodecNCrush.c TestFreeRDPCodecXCrush.c) endif()