diff --git a/CMakeLists.txt b/CMakeLists.txt index d40beda92a77..f2156016d4b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1867,11 +1867,29 @@ if(LILV) endif() # Live Broadcasting (Shoutcast) -find_package(Shout) -cmake_dependent_option(BROADCAST "Live Broadcasting (Shoutcast) support" ON "Shout_FOUND" OFF) +option(BROADCAST "Live Broadcasting (Shoutcast) support" ON) if(BROADCAST) - if(NOT Shout_FOUND) + find_package(Shout) + if(UNIX AND NOT APPLE) + # Check if system lib is at least 2.4.4 and not suffering bug + # https://bugs.launchpad.net/mixxx/+bug/1833225 + if(Shout_FOUND AND Shout_VERSION VERSION_LESS 2.4.4) + message(STATUS "Installed libshout version is suffering from bug lp1833225") + endif() + if(NOT Shout_FOUND OR Shout_VERSION VERSION_LESS 2.4.4) + # Fall back to internal libraray in the lib tree + message(STATUS "Using internal libshout") + add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/libshout") + target_include_directories(mixxx-lib PUBLIC lib/libshout/include) + target_link_libraries(mixxx-lib PUBLIC shout_mixxx) + else() + target_link_libraries(mixxx-lib PUBLIC Shout::Shout) + endif() + else() + if(NOT Shout_FOUND) message(FATAL_ERROR "Live Broadcasting support requires the libshout and its development headers.") + endif() + target_link_libraries(mixxx-lib PUBLIC Shout::Shout) endif() target_sources(mixxx-lib PRIVATE src/preferences/dialog/dlgprefbroadcastdlg.ui @@ -1880,7 +1898,6 @@ if(BROADCAST) src/engine/sidechain/shoutconnection.cpp ) target_compile_definitions(mixxx-lib PUBLIC __BROADCAST__) - target_link_libraries(mixxx-lib PUBLIC Shout::Shout) endif() # Locale Aware Compare for SQLite diff --git a/lib/libshout/CMakeLists.txt b/lib/libshout/CMakeLists.txt new file mode 100644 index 000000000000..423da3a316a3 --- /dev/null +++ b/lib/libshout/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.0) +project(shout_mixxx C) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_CONFIG_H -Wall -ffast-math -pthread -g -O2") + +include_directories( + . + src + include + src/common +) + +add_library(shout_mixxx STATIC + src/common/avl/avl.c + src/common/net/sock.c + src/common/net/resolver.c + src/common/timing/timing.c + src/common/httpp/httpp.c + src/common/httpp/encoding.c + src/common/thread/thread.c + src/shout.c + src/util.c + src/queue.c + src/proto_http.c + src/proto_xaudiocast.c + src/proto_icy.c + src/proto_roaraudio.c + src/format_ogg.c + src/format_webm.c + src/format_mp3.c + src/codec_vorbis.c + src/codec_opus.c + src/codec_theora.c + src/codec_speex.c + src/tls.c +) + +target_link_libraries(shout_mixxx ogg vorbis theora speex ssl crypto) + +