diff --git a/samples/videoplayer/README.md b/samples/videoplayer/README.md index c73166aacb5..c6731fbcfc4 100644 --- a/samples/videoplayer/README.md +++ b/samples/videoplayer/README.md @@ -8,6 +8,7 @@ ffmpeg and SDL2 is needed for that to work, i.e. apt install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \ libavresample-dev apt install libsdl2-dev + pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-ffmpeg To build use `../gradlew build`. diff --git a/samples/videoplayer/build.gradle b/samples/videoplayer/build.gradle index 169e452babf..fd97c092937 100644 --- a/samples/videoplayer/build.gradle +++ b/samples/videoplayer/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'konan' -konan.targets = ['macbook', 'linux'] +konan.targets = ['macbook', 'linux', 'mingw'] konanArtifacts { interop('ffmpeg') { @@ -9,9 +9,14 @@ konanArtifacts { target 'linux', { includeDirs '/usr/include', '/usr/include/x86_64-linux-gnu' } + target 'macbook', { includeDirs '/opt/local/include', '/usr/local/include' } + + target 'mingw', { + includeDirs 'C:/msys64/mingw64/include' + } } interop ('sdl') { @@ -27,6 +32,10 @@ konanArtifacts { target 'linux', { includeDirs '/usr/include/SDL2' } + + target 'mingw', { + includeDirs 'C:/msys64/mingw64/include/SDL2' + } } program('Player') { @@ -34,6 +43,7 @@ konanArtifacts { artifact 'ffmpeg' artifact 'sdl' } + target 'macbook', { linkerOpts "-F ${System.getProperty("user.home")}/Library/Frameworks -F /Library/Frameworks -L/opt/local/lib" } @@ -41,5 +51,9 @@ konanArtifacts { target 'linux', { linkerOpts '-L/usr/lib/x86_64-linux-gnu' } + + target 'mingw', { + linkerOpts '-LC:/msys64/mingw64/lib' + } } } diff --git a/samples/videoplayer/src/main/c_interop/sdl.def b/samples/videoplayer/src/main/c_interop/sdl.def index b11c16c89be..61665b576c3 100644 --- a/samples/videoplayer/src/main/c_interop/sdl.def +++ b/samples/videoplayer/src/main/c_interop/sdl.def @@ -4,5 +4,4 @@ entryPoint = SDL_main headerFilter = SDL* -linkerOpts.osx = -lSDL2 -linkerOpts.linux = -lSDL2 \ No newline at end of file +linkerOpts = -lSDL2