Skip to content

Commit c5534c8

Browse files
authored
Enable and fix multiple modules with MSVC (#1194)
* Enable and fix avformat module with MSVC * Enable and fix qt6 module with MSVC * Enable and fix xml module with MSVC * Enable and fix mlt plus module with MSVC * Enable and fix kdenlive module with MSVC * Enable and fix gdk module with MSVC * Enable and fix normalize module with MSVC * Enable and fix oldfilm module with MSVC * Enable rubberband module with MSVC * Enable and fix vorbis module with MSVC
1 parent 799b222 commit c5534c8

File tree

16 files changed

+70
-19
lines changed

16 files changed

+70
-19
lines changed

CMakePresets.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,33 @@
1010
"cacheVariables": {
1111
"BUILD_TESTING": "OFF",
1212
"SWIG_PYTHON": "OFF",
13-
"MOD_AVFORMAT": "OFF",
13+
"MOD_AVFORMAT": "ON",
1414
"MOD_DECKLINK": "OFF",
1515
"MOD_FREI0R": "OFF",
16-
"MOD_GDK": "OFF",
16+
"MOD_GDK": "ON",
1717
"MOD_JACKRACK": "OFF",
1818
"USE_LV2": "OFF",
1919
"USE_VST2": "OFF",
20-
"MOD_KDENLIVE": "OFF",
20+
"MOD_KDENLIVE": "ON",
2121
"MOD_NDI": "OFF",
22-
"MOD_NORMALIZE": "OFF",
23-
"MOD_OLDFILM": "OFF",
22+
"MOD_NORMALIZE": "ON",
23+
"MOD_OLDFILM": "ON",
2424
"MOD_OPENCV": "OFF",
2525
"MOD_MOVIT": "OFF",
26-
"MOD_PLUS": "OFF",
26+
"MOD_PLUS": "ON",
2727
"MOD_PLUSGPL": "OFF",
28-
"MOD_QT6": "OFF",
28+
"MOD_QT6": "ON",
2929
"MOD_SOX": "OFF",
3030
"MOD_GLAXNIMATE_QT6": "OFF",
3131
"MOD_RESAMPLE": "OFF",
3232
"MOD_RTAUDIO": "OFF",
33-
"MOD_RUBBERBAND": "OFF",
33+
"MOD_RUBBERBAND": "ON",
3434
"MOD_SDL2": "ON",
3535
"MOD_DOX": "OFF",
3636
"MOD_VIDSTAB": "OFF",
37-
"MOD_VORBIS": "OFF",
37+
"MOD_VORBIS": "ON",
3838
"MOD_XINE": "OFF",
39-
"MOD_XML": "OFF"
39+
"MOD_XML": "ON"
4040
}
4141
},
4242
{

src/modules/avformat/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ target_link_libraries(mltavformat PRIVATE
3939
)
4040

4141
if(MSVC)
42-
target_link_libraries(mltavformat PRIVATE PThreads4W::PThreads4W)
42+
target_link_libraries(mltavformat PRIVATE PThreads4W::PThreads4W msvccompat)
4343
else()
4444
target_link_libraries(mltavformat PRIVATE m)
4545
endif()

src/modules/avformat/consumer_avformat.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@
3131
#include <stdio.h>
3232
#include <stdlib.h>
3333
#include <string.h>
34-
#include <sys/time.h>
3534
#include <time.h>
35+
36+
#ifdef _MSC_VER
37+
#include <gettimeofday.h>
38+
#else
39+
#include <sys/time.h>
3640
#include <unistd.h>
41+
#endif
3742

3843
// avformat header files
3944
#include <libavcodec/avcodec.h>

src/modules/gdk/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ target_compile_options(mltgdk PRIVATE ${MLT_COMPILE_OPTIONS})
1616
target_include_directories(mltgdk PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
1717

1818
target_link_libraries(mltgdk PRIVATE mlt Threads::Threads PkgConfig::GdkPixbuf)
19-
if(NOT MSVC)
19+
if(MSVC)
20+
target_link_libraries(mltgdk PRIVATE PThreads4W::PThreads4W)
21+
else()
2022
target_link_libraries(mltgdk PRIVATE m)
2123
endif()
2224

src/modules/gdk/producer_pixbuf.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,19 @@
3737
#include <string.h>
3838
#include <sys/stat.h>
3939
#include <sys/types.h>
40+
41+
#ifndef _MSC_VER
4042
#include <unistd.h>
43+
#endif
44+
45+
#ifndef ssize_t
46+
#ifdef _WIN32
47+
#include <BaseTsd.h>
48+
#define ssize_t SSIZE_T
49+
#else
50+
#define ssize_t ptrdiff_t
51+
#endif
52+
#endif
4153

4254
// this protects concurrent access to gdk_pixbuf
4355
static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;

src/modules/kdenlive/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ generate_export_header(mltkdenlive)
1515
target_compile_options(mltkdenlive PRIVATE ${MLT_COMPILE_OPTIONS})
1616
target_include_directories(mltkdenlive PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
1717
target_link_libraries(mltkdenlive PRIVATE mlt)
18-
if(NOT MSVC)
18+
if(MSVC)
19+
target_link_libraries(mltkdenlive PRIVATE PThreads4W::PThreads4W)
20+
else()
1921
target_link_libraries(mltkdenlive PRIVATE m)
2022
endif()
2123

src/modules/kdenlive/producer_framebuffer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
#include <stdio.h>
2727
#include <stdlib.h>
2828
#include <string.h>
29+
30+
#ifndef _MSC_VER
2931
#include <sys/time.h>
32+
#endif
3033

3134
// Forward references.
3235
static int producer_get_frame(mlt_producer producer, mlt_frame_ptr frame, int index);

src/modules/normalize/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ generate_export_header(mltnormalize)
1313
target_compile_options(mltnormalize PRIVATE ${MLT_COMPILE_OPTIONS})
1414
target_include_directories(mltnormalize PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
1515
target_link_libraries(mltnormalize PRIVATE mlt)
16-
if(NOT MSVC)
16+
if(MSVC)
17+
target_link_libraries(mltnormalize PRIVATE PThreads4W::PThreads4W)
18+
else()
1719
target_link_libraries(mltnormalize PRIVATE m)
1820
endif()
1921

src/modules/oldfilm/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ generate_export_header(mltoldfilm)
1818
target_compile_options(mltoldfilm PRIVATE ${MLT_COMPILE_OPTIONS})
1919
target_include_directories(mltoldfilm PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
2020
target_link_libraries(mltoldfilm PRIVATE mlt)
21-
if(NOT MSVC)
21+
if(MSVC)
22+
target_link_libraries(mltoldfilm PRIVATE PThreads4W::PThreads4W)
23+
else()
2224
target_link_libraries(mltoldfilm PRIVATE m)
2325
endif()
2426

src/modules/plus/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ target_compile_options(mltplus PRIVATE ${MLT_COMPILE_OPTIONS})
4444
target_include_directories(mltplus PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
4545
target_link_libraries(mltplus PRIVATE mlt Threads::Threads)
4646
if(MSVC)
47-
target_link_libraries(mltplus PRIVATE msvccompat)
47+
target_link_libraries(mltplus PRIVATE PThreads4W::PThreads4W msvccompat)
4848
else()
4949
target_link_libraries(mltplus PRIVATE m)
5050
endif()

0 commit comments

Comments
 (0)