summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2021-03-17 20:21:42 +0100
committerGitHub <noreply@github.com>2021-03-17 20:21:42 +0100
commit2e66d935f8a5bded07e357b67d094ed766fda390 (patch)
treeb5cd616b5909c184814096ca5128aa37606818b7
parentbca86b109f9244dbcdc8ab16b16fdb3a799807eb (diff)
parente402aaeda14a4b5e7bff9ad3c7701c616c8db7dd (diff)
Merge pull request #3707 from uklotzde/windows-ffmpeg
Windows: Enable, test, and then disable SoundSourceFFmpeg as fallback
-rw-r--r--.github/workflows/build.yml5
-rw-r--r--CMakeLists.txt76
-rw-r--r--cmake/modules/FindFFMPEG.cmake3
-rw-r--r--tools/windows_buildenv.bat1
4 files changed, 43 insertions, 42 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 1b0ae896ca..d30e20735b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -15,6 +15,7 @@ jobs:
cmake_args: >-
-DWARNINGS_FATAL=ON
-DFAAD=ON
+ -DFFMPEG=OFF
-DLOCALECOMPARE=ON
-DMAD=ON
-DMODPLUG=ON
@@ -73,7 +74,9 @@ jobs:
qt_qpa_platform: offscreen
- name: Windows 2019 (MSVC)
os: windows-2019
+ # TODO: Reenable FFmpeg after licensing issues have been clarified
cmake_args: >-
+ -DFFMPEG=OFF
-DHSS1394=ON
-DKEYFINDER=OFF
-DLOCALECOMPARE=ON
@@ -216,7 +219,7 @@ jobs:
cmake
-G "${{ matrix.cmake_generator }}"
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
- "-DCMAKE_PREFIX_PATH=${{ env.CMAKE_PREFIX_PATH }}"
+ -DCMAKE_PREFIX_PATH="${{ env.CMAKE_PREFIX_PATH }}"
-DDEBUG_ASSERTIONS_FATAL=ON
-DQt5_DIR=${{ env.QT_PATH }} ${{ matrix.cmake_args }} ${{ env.CMAKE_ARGS_EXTRA }}
-DBATTERY=ON
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cefec26130..ec6222c42d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2301,27 +2301,26 @@ endif()
# FFmpeg 4.x support
# FFmpeg is multimedia library that can be found http://ffmpeg.org/
find_package(FFMPEG COMPONENTS libavcodec libavformat libavutil libswresample)
-cmake_dependent_option(FFMPEG "FFmpeg 4.x support" ON "FFMPEG_FOUND;FFMPEG_libavcodec_VERSION VERSION_GREATER_EQUAL 58" OFF)
+cmake_dependent_option(FFMPEG "FFmpeg 4.x support" ON "FFMPEG_FOUND" OFF)
if(FFMPEG)
- if(NOT FFMPEG_libavcodec_FOUND)
- message(FATAL_ERROR "FFmpeg support requires libavcodec and its development headers.")
- elseif(FFMPEG_libavcodec_VERSION AND FFMPEG_libavcodec_VERSION VERSION_LESS 58)
- message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavcodec (found: ${AVCODEC_VERSION}).")
+ if(NOT FFMPEG_FOUND)
+ message(FATAL_ERROR "FFMPEG was not found")
endif()
- if(NOT FFMPEG_libavformat_FOUND)
- message(FATAL_ERROR "FFmpeg support requires libavformat and its development headers.")
- elseif(FFMPEG_libavformat_VERSION AND FFMPEG_libavformat_VERSION VERSION_LESS 58)
- message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavformat (found: ${AVFORMAT_VERSION}).")
+
+ # Check minimum required versions
+ # Windows: Version numbers are not available!?
+ # macOS: Untested
+ if(FFMPEG_libavcodec_VERSION AND FFMPEG_libavcodec_VERSION VERSION_LESS 58)
+ message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavcodec (found: ${FFMPEG_libavcodec_VERSION}).")
+ endif()
+ if(FFMPEG_libavformat_VERSION AND FFMPEG_libavformat_VERSION VERSION_LESS 58)
+ message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavformat (found: ${FFMPEG_libavformat_VERSION}).")
endif()
- if(NOT FFMPEG_libavutil_FOUND)
- message(FATAL_ERROR "FFmpeg support requires libavutil and its development headers.")
- elseif(FFMPEG_libavutil_VERSION AND FFMPEG_libavutil_VERSION VERSION_LESS 56)
- message(FATAL_ERROR "FFmpeg support requires at least version 56 of libavutil (found: ${AVUTIL_VERSION}).")
+ if(FFMPEG_libavutil_VERSION AND FFMPEG_libavutil_VERSION VERSION_LESS 56)
+ message(FATAL_ERROR "FFmpeg support requires at least version 56 of libavutil (found: ${FFMPEG_libavutil_VERSION}).")
endif()
- if(NOT FFMPEG_libswresample_FOUND)
- message(FATAL_ERROR "FFmpeg support requires libswresample and its development headers.")
- elseif(FFMPEG_libswresample_VERSION AND FFMPEG_libswresample_VERSION VERSION_LESS 3.1)
- message(FATAL_ERROR "FFmpeg support requires at least version 3.1 of libswresample (found: ${SWRESAMPLE_VERSION}).")
+ if(FFMPEG_libswresample_VERSION AND FFMPEG_libswresample_VERSION VERSION_LESS 3.1)
+ message(FATAL_ERROR "FFmpeg support requires at least version 3.1 of libswresample (found: ${FFMPEG_libswresample_VERSION}).")
endif()
target_sources(mixxx-lib PRIVATE src/sources/soundsourceffmpeg.cpp)
@@ -2332,7 +2331,6 @@ if(FFMPEG)
__STDC_LIMIT_MACROS
__STDC_FORMAT_MACROS
)
-
target_link_libraries(mixxx-lib PUBLIC "${FFMPEG_LIBRARIES}")
target_include_directories(mixxx-lib PUBLIC "${FFMPEG_INCLUDE_DIRS}")
endif()
@@ -2421,11 +2419,7 @@ find_package(SQLite3)
# FIXME
# It is difficult to get qmake to link Qt to a custom built SQLite on macOS instead of the system SQLite,
# which results in a crash on startup when LOCALECOMPARE is enabled.
-if(APPLE)
- cmake_dependent_option(LOCALECOMPARE "Locale Aware Compare support for SQLite" OFF "SQLite3_FOUND" OFF)
-else()
- cmake_dependent_option(LOCALECOMPARE "Locale Aware Compare support for SQLite" ON "SQLite3_FOUND" OFF)
-endif()
+cmake_dependent_option(LOCALECOMPARE "Locale Aware Compare support for SQLite" ON "SQLite3_FOUND AND NOT APPLE" OFF)
if(LOCALECOMPARE)
if(NOT SQLite3_FOUND)
message(FATAL_ERROR "Locale Aware Compare for SQLite requires libsqlite and its development headers.")
@@ -2482,22 +2476,24 @@ if(MAD)
endif()
# Media Foundation AAC Decoder Plugin
-find_package(MediaFoundation)
-cmake_dependent_option(MEDIAFOUNDATION "Media Foundation AAC decoder plugin (Windows Vista with KB2117917 or Windows 7 required)" ON "MediaFoundation_FOUND" OFF)
-if(MEDIAFOUNDATION)
- if(NOT MediaFoundation_FOUND)
- message(FATAL_ERROR "MediaFoundation support requires the MediaFoundation libraries and its development headers.")
+if(WIN32)
+ find_package(MediaFoundation)
+ cmake_dependent_option(MEDIAFOUNDATION "Media Foundation AAC decoder plugin" ON "MediaFoundation_FOUND" OFF)
+ if(MEDIAFOUNDATION)
+ if(NOT MediaFoundation_FOUND)
+ message(FATAL_ERROR "MediaFoundation support requires the MediaFoundation libraries and its development headers.")
+ endif()
+ target_sources(mixxx-lib PRIVATE
+ src/sources/soundsourcemediafoundation.cpp
+ )
+ target_compile_definitions(mixxx-lib PUBLIC __MEDIAFOUNDATION__)
+ target_include_directories(mixxx-lib SYSTEM PRIVATE
+ ${MediaFoundation_INCLUDE_DIRS}
+ )
+ target_link_libraries(mixxx-lib PUBLIC
+ ${MediaFoundation_LIBRARIES}
+ )
endif()
- target_sources(mixxx-lib PRIVATE
- src/sources/soundsourcemediafoundation.cpp
- )
- target_compile_definitions(mixxx-lib PUBLIC __MEDIAFOUNDATION__)
- target_include_directories(mixxx-lib SYSTEM PRIVATE
- ${MediaFoundation_INCLUDE_DIRS}
- )
- target_link_libraries(mixxx-lib PUBLIC
- ${MediaFoundation_LIBRARIES}
- )
endif()
# Modplug support
@@ -2626,9 +2622,9 @@ endif()
# WavPack audio file support
find_package(wavpack)
-option(WAVPACK "WavPack audio file support" OFF)
+cmake_dependent_option(BULK "WavPack audio file support" ON "wavpack_FOUND" OFF)
if(WAVPACK)
- if(NOT TARGET WavPack::wavpack)
+ if(NOT wavpack_FOUND)
message(FATAL_ERROR "WavPack audio file support requires libwv and its development headers.")
endif()
target_sources(mixxx-lib PRIVATE src/sources/soundsourcewv.cpp)
diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake
index 91d78d586e..7316987c67 100644
--- a/cmake/modules/FindFFMPEG.cmake
+++ b/cmake/modules/FindFFMPEG.cmake
@@ -33,6 +33,7 @@
# libavutil
# libpostproc
# libswscale
+# libswresample
#
# the following variables will be defined
#
@@ -105,7 +106,7 @@ macro(find_component _component _pkgconfig _library _header)
set(FFMPEG_${_component}_VERSION ${PC_FFMPEG_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
if (FFMPEG_${_component}_LIBRARIES AND FFMPEG_${_component}_INCLUDE_DIRS)
- message(STATUS " - ${_component} found.")
+ message(STATUS " - ${_component} ${FFMPEG_${_component}_VERSION} found.")
set(FFMPEG_${_component}_FOUND TRUE)
else ()
message(STATUS " - ${_component} not found.")
diff --git a/tools/windows_buildenv.bat b/tools/windows_buildenv.bat
index 243b3b0b97..eae170dffe 100644
--- a/tools/windows_buildenv.bat
+++ b/tools/windows_buildenv.bat
@@ -181,6 +181,7 @@ REM Generate CMakeSettings.json which is read by MS Visual Studio to determine t
REM Replace all \ by \\ in CMAKE_PREFIX_PATH
CALL :AddCMakeVar2CMakeSettings_JSON "CMAKE_PREFIX_PATH" "STRING" "!CMAKE_PREFIX_PATH:\=\\!"
CALL :AddCMakeVar2CMakeSettings_JSON "DEBUG_ASSERTIONS_FATAL" "BOOL" "True"
+ CALL :AddCMakeVar2CMakeSettings_JSON "FFMPEG" "BOOL" "True"
CALL :AddCMakeVar2CMakeSettings_JSON "HID" "BOOL" "True"
CALL :AddCMakeVar2CMakeSettings_JSON "HSS1394" "BOOL" "True"
CALL :AddCMakeVar2CMakeSettings_JSON "KEYFINDER" "BOOL" "False"