From f94a78d53e24580c53c67297e4919883ef873846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= <78424983+jlskuz@users.noreply.github.com> Date: Sun, 25 Jan 2026 23:25:05 +0100 Subject: [PATCH 1/7] Make sure dirent is available on MSVC It is a header only library with a single header (dirent.h). vcpkg installs this header with a custom logic to the global include path. However in other environments without modification upstream has to be treated like a usual library n cmake. "Linking" against the interface makes sure, that it is found and that the include paths are available for us. To conver both scenarios we use a FindDirent.cmake --- CMakeLists.txt | 1 + cmake/FindDirent.cmake | 21 +++++++++++++++++++++ src/framework/CMakeLists.txt | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 cmake/FindDirent.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ca5f98b3..263bb1946 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,6 +190,7 @@ endif() if (MSVC) find_package(PThreads4W REQUIRED) + find_package(Dirent 1.26 REQUIRED) endif () find_package(Threads REQUIRED) find_package(PkgConfig REQUIRED) diff --git a/cmake/FindDirent.cmake b/cmake/FindDirent.cmake new file mode 100644 index 000000000..ff8a72503 --- /dev/null +++ b/cmake/FindDirent.cmake @@ -0,0 +1,21 @@ +find_package(Dirent CONFIG) + +if(NOT Dirent_FOUND) + include(FindPackageHandleStandardArgs) + + find_path(Dirent_INCLUDE_DIR + NAMES dirent.h + ) + + find_package_handle_standard_args(Dirent + REQUIRED_VARS + Dirent_INCLUDE_DIR + ) + + if(Dirent_FOUND AND NOT TARGET dirent) + add_library(dirent INTERFACE) + set_target_properties(dirent PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${Dirent_INCLUDE_DIR}" + ) + endif() +endif() diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index aae6c994f..6d16e0938 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -87,7 +87,7 @@ target_compile_options(mlt PRIVATE ${MLT_COMPILE_OPTIONS}) target_link_libraries(mlt PRIVATE Threads::Threads ${CMAKE_DL_LIBS}) if(MSVC) - target_link_libraries(mlt PRIVATE msvccompat PThreads4W::PThreads4W) + target_link_libraries(mlt PRIVATE msvccompat PThreads4W::PThreads4W dirent) else() target_link_libraries(mlt PRIVATE m) endif() From 007a64187eee1f9440c960529c9e2b96f9801c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= <78424983+jlskuz@users.noreply.github.com> Date: Sun, 25 Jan 2026 23:30:44 +0100 Subject: [PATCH 2/7] Don't require Kwalify for tests on MSVC Kwalify is used to validate MLT's YAML files, but it is not available for MSVC easily (eg. via vcpkg). This is only relevant for local setups, because for CI it is covered by other plattforms and the results of YAML validation are plattform independent --- CMakeLists.txt | 5 ++++- src/tests/CMakeLists.txt | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 263bb1946..1540c5ee3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -336,7 +336,10 @@ endif() if(BUILD_TESTING) find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Core Test) - find_package(Kwalify REQUIRED) + if(NOT MSVC) + # Kwalify is not available for MSVC easily (eg. via vcpkg) + find_package(Kwalify REQUIRED) + endif() enable_testing() endif() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 720225649..efbdd3716 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -51,12 +51,13 @@ if(MOD_QT6) ) endif() - -file(GLOB YML_FILES "${CMAKE_SOURCE_DIR}/src/modules/*/*.yml") -foreach(YML_FILE ${YML_FILES}) - get_filename_component(FILE_NAME ${YML_FILE} NAME) - file(RELATIVE_PATH KWALIFY_TEST_NAME "${CMAKE_SOURCE_DIR}/src/modules" ${YML_FILE}) - if(NOT FILE_NAME MATCHES "resolution_scale.yml") - add_test(NAME "kwalify:${KWALIFY_TEST_NAME}" COMMAND ${Kwalify_EXECUTABLE} -f "${CMAKE_SOURCE_DIR}/src/framework/metaschema.yaml" ${YML_FILE}) - endif() -endforeach() +if(Kwalify_FOUND) + file(GLOB YML_FILES "${CMAKE_SOURCE_DIR}/src/modules/*/*.yml") + foreach(YML_FILE ${YML_FILES}) + get_filename_component(FILE_NAME ${YML_FILE} NAME) + file(RELATIVE_PATH KWALIFY_TEST_NAME "${CMAKE_SOURCE_DIR}/src/modules" ${YML_FILE}) + if(NOT FILE_NAME MATCHES "resolution_scale.yml") + add_test(NAME "kwalify:${KWALIFY_TEST_NAME}" COMMAND ${Kwalify_EXECUTABLE} -f "${CMAKE_SOURCE_DIR}/src/framework/metaschema.yaml" ${YML_FILE}) + endif() + endforeach() +endif() \ No newline at end of file From 99df4404c3f609ad6298ced4dbb4696108a066cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= <78424983+jlskuz@users.noreply.github.com> Date: Sun, 25 Jan 2026 23:33:14 +0100 Subject: [PATCH 3/7] Add missing direct.h include for getcwd on MSVC --- src/modules/xml/consumer_xml.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/xml/consumer_xml.c b/src/modules/xml/consumer_xml.c index b5442d0f5..878db67fe 100644 --- a/src/modules/xml/consumer_xml.c +++ b/src/modules/xml/consumer_xml.c @@ -29,6 +29,8 @@ #ifndef _MSC_VER #include +#else +#include #endif #define ID_SIZE 128 From 8c6ffeeeddc0936e8ca9f19e67ac0d3e5d26d5d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Mon, 26 Jan 2026 10:59:39 +0100 Subject: [PATCH 4/7] Add fftw3 dependency to vcpkg build --- vcpkg.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 2299fb7be..b62885cae 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -15,6 +15,7 @@ "libebur128", "gdk-pixbuf", "rubberband", - "libvorbis" + "libvorbis", + "fftw3" ] } From c49297f526504645f8a488b628ba194f530390b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Mon, 26 Jan 2026 11:01:53 +0100 Subject: [PATCH 5/7] Fix spelling and duplicated entry in CMake preset --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 324cbe961..0bb636dd5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -32,7 +32,7 @@ "MOD_RTAUDIO": "OFF", "MOD_RUBBERBAND": "ON", "MOD_SDL2": "ON", - "MOD_DOX": "OFF", + "MOD_SPATIALAUDIO": "OFF", "MOD_VIDSTAB": "OFF", "MOD_VORBIS": "ON", "MOD_XINE": "OFF", From 40ad3cd261eb9ab1a05a7778585bca778c65b612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Mon, 26 Jan 2026 11:05:47 +0100 Subject: [PATCH 6/7] Enable build of tests on MSVC CI --- .github/workflows/build-windows-msvc.yml | 4 ++++ CMakePresets.json | 2 +- src/tests/CMakeLists.txt | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-windows-msvc.yml b/.github/workflows/build-windows-msvc.yml index 0d0e27df0..005731d8b 100644 --- a/.github/workflows/build-windows-msvc.yml +++ b/.github/workflows/build-windows-msvc.yml @@ -50,3 +50,7 @@ jobs: - name: Install MLT run: | cmake --install build + + - name: Run tests + run: | + ctest --test-dir build -C Debug diff --git a/CMakePresets.json b/CMakePresets.json index 0bb636dd5..081af7d6d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -8,7 +8,7 @@ "binaryDir": "${sourceDir}/build", "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", "cacheVariables": { - "BUILD_TESTING": "OFF", + "BUILD_TESTING": "ON", "SWIG_PYTHON": "OFF", "MOD_AVFORMAT": "ON", "MOD_DECKLINK": "OFF", diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index efbdd3716..eca7b0306 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -18,6 +18,10 @@ function(add_qt_test) mlt++ ${ARG_LINK_LIBRARIES} ) + if(MSVC) + target_link_libraries(${_testname} PRIVATE PThreads4W::PThreads4W) + endif() + target_include_directories(${_testname} PRIVATE ${arg_INCLUDE_DIRS}) add_test(NAME "QtTest:${arg_TEST_NAME}" COMMAND ${_testname}) @@ -60,4 +64,4 @@ if(Kwalify_FOUND) add_test(NAME "kwalify:${KWALIFY_TEST_NAME}" COMMAND ${Kwalify_EXECUTABLE} -f "${CMAKE_SOURCE_DIR}/src/framework/metaschema.yaml" ${YML_FILE}) endif() endforeach() -endif() \ No newline at end of file +endif() From beeff2aac27694e587ed4910caf5a8cc0b2181ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Mon, 26 Jan 2026 11:13:36 +0100 Subject: [PATCH 7/7] Add optional libexif dep to vcpkg --- vcpkg.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index b62885cae..a01b9155f 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -16,6 +16,7 @@ "gdk-pixbuf", "rubberband", "libvorbis", - "fftw3" + "fftw3", + "libexif" ] }