Fixes for protobuf/absl C++17 requirement
This commit is contained in:
parent
126da35fef
commit
b74564a06f
2
3rdparty/libprojectm/CMakeLists.txt
vendored
2
3rdparty/libprojectm/CMakeLists.txt
vendored
@ -175,7 +175,7 @@ if(BUNDLE_PROJECTM_PRESETS)
|
||||
configure_file(
|
||||
"${preset}"
|
||||
"${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources/projectm-presets/${PRESET_NAME}"
|
||||
COPY_ONLY
|
||||
COPYONLY
|
||||
)
|
||||
endforeach (preset)
|
||||
else (APPLE)
|
||||
|
7
3rdparty/libprojectm/Renderer/Waveform.cpp
vendored
7
3rdparty/libprojectm/Renderer/Waveform.cpp
vendored
@ -17,8 +17,11 @@
|
||||
|
||||
#include "Waveform.hpp"
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include "BeatDetect.hpp"
|
||||
|
||||
using std::placeholders::_1;
|
||||
|
||||
typedef float floatPair[2];
|
||||
typedef float floatTriple[3];
|
||||
typedef float floatQuad[4];
|
||||
@ -65,8 +68,8 @@ void Waveform::Draw(RenderContext &context)
|
||||
float mult= scaling*( spectrum ? 0.015f :1.0f);
|
||||
|
||||
|
||||
std::transform(&value1[0],&value1[samples],&value1[0],std::bind2nd(std::multiplies<float>(),mult));
|
||||
std::transform(&value2[0],&value2[samples],&value2[0],std::bind2nd(std::multiplies<float>(),mult));
|
||||
std::transform(&value1[0],&value1[samples],&value1[0],std::bind(std::multiplies<float>(),_1, mult));
|
||||
std::transform(&value2[0],&value2[samples],&value2[0],std::bind(std::multiplies<float>(),_1,mult));
|
||||
|
||||
WaveformContext waveContext(samples, context.beatDetect);
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include <random>
|
||||
|
||||
namespace omptl
|
||||
{
|
||||
@ -463,14 +464,15 @@ template <class RandomAccessIterator>
|
||||
void random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
|
||||
const unsigned P)
|
||||
{
|
||||
return ::std::random_shuffle(first, last);
|
||||
std::random_device rd;
|
||||
return ::std::shuffle(first, last, std::mt19937(rd()));
|
||||
}
|
||||
|
||||
template <class RandomAccessIterator, class RandomNumberGenerator>
|
||||
void random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
|
||||
RandomNumberGenerator &rgen, const unsigned P)
|
||||
{
|
||||
return ::std::random_shuffle(first, last, rgen);
|
||||
return ::std::shuffle(first, last, rgen);
|
||||
}
|
||||
|
||||
template <class ForwardIterator, class T>
|
||||
|
@ -46,7 +46,7 @@ endif(OPENGL_FOUND)
|
||||
find_package(Boost REQUIRED)
|
||||
find_package(Gettext REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Protobuf REQUIRED)
|
||||
find_package(protobuf REQUIRED CONFIG)
|
||||
find_package(FFTW3)
|
||||
find_package(ALSA)
|
||||
if (NOT APPLE)
|
||||
|
14
dist/macdeploy.py
vendored
14
dist/macdeploy.py
vendored
@ -35,11 +35,11 @@ STRIP_PREFIX = [
|
||||
'@@HOMEBREW_CELLAR@@/qt5/5.8.0_1/lib/',
|
||||
]
|
||||
|
||||
LIBRARY_SEARCH_PATH = ['/target', '/target/lib', '/usr/local/lib', '/sw/lib']
|
||||
LIBRARY_SEARCH_PATH = ['/opt/homebrew/lib', '/target', '/target/lib', '/usr/local/lib', '/sw/lib']
|
||||
|
||||
GSTREAMER_PLUGINS = [
|
||||
# Core plugins
|
||||
'libgstapp.dylib',
|
||||
'libgstapp-1.0.dylib',
|
||||
'libgstaudioconvert.dylib',
|
||||
'libgstaudiofx.dylib',
|
||||
'libgstaudiotestsrc.dylib',
|
||||
@ -88,10 +88,12 @@ GSTREAMER_PLUGINS = [
|
||||
]
|
||||
|
||||
GSTREAMER_SEARCH_PATH = [
|
||||
'/opt/homebrew/lib',
|
||||
'/usr/local/lib/gstreamer-1.0',
|
||||
'/target/lib/gstreamer-1.0',
|
||||
'/target/libexec/gstreamer-1.0',
|
||||
'/usr/local/opt/gstreamer/libexec/gstreamer-1.0',
|
||||
'/opt/homebrew/Cellar/gstreamer/1.22.4/libexec/gstreamer-1.0',
|
||||
]
|
||||
|
||||
QT_PLUGINS = [
|
||||
@ -110,6 +112,7 @@ QT_PLUGINS = [
|
||||
'styles/libqmacstyle.dylib',
|
||||
]
|
||||
QT_PLUGINS_SEARCH_PATH = [
|
||||
'/opt/homebrew/Cellar/qt@5/5.15.10/plugins',
|
||||
'/usr/local/opt/qt5/plugins',
|
||||
'/target/plugins',
|
||||
'/usr/local/Trolltech/Qt-4.7.0/plugins',
|
||||
@ -117,6 +120,7 @@ QT_PLUGINS_SEARCH_PATH = [
|
||||
]
|
||||
|
||||
GIO_MODULES_SEARCH_PATH = [
|
||||
'/opt/homebrew/lib/gio/modules',
|
||||
'/usr/local/lib/gio/modules',
|
||||
'/target/lib/gio/modules',
|
||||
]
|
||||
@ -204,6 +208,12 @@ def GetBrokenLibraries(binary):
|
||||
*os.path.split(line)[1:],
|
||||
)
|
||||
broken_libs['libs'].append(abs_path)
|
||||
elif re.match(r'^\s*@rpath', line):
|
||||
abs_path = os.path.join(
|
||||
os.path.dirname(binary),
|
||||
*os.path.split(line)[1:],
|
||||
)
|
||||
broken_libs['libs'].append(abs_path)
|
||||
elif re.match(r'^\s*@executable_path', line):
|
||||
# Potentially already fixed library
|
||||
relative_path = os.path.join(*line.split('/')[3:])
|
||||
|
@ -32,6 +32,11 @@ target_link_libraries(clementine-tagreader
|
||||
z
|
||||
)
|
||||
|
||||
set_property(
|
||||
TARGET clementine-tagreader
|
||||
PROPERTY CXX_STANDARD 17
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
target_link_libraries(clementine-tagreader
|
||||
execinfo
|
||||
|
@ -33,6 +33,11 @@ add_library(libclementine-common STATIC
|
||||
${MOC}
|
||||
)
|
||||
|
||||
set_property(
|
||||
TARGET libclementine-common
|
||||
PROPERTY CXX_STANDARD 17
|
||||
)
|
||||
|
||||
target_link_libraries(libclementine-common
|
||||
Qt5::Core
|
||||
Qt5::Network
|
||||
|
@ -6,14 +6,27 @@ set(MESSAGES
|
||||
remotecontrolmessages.proto
|
||||
)
|
||||
|
||||
protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES})
|
||||
add_library(libclementine-remote STATIC)
|
||||
|
||||
add_library(libclementine-remote STATIC
|
||||
${PROTO_SOURCES}
|
||||
protobuf_generate(
|
||||
LANGUAGE cpp
|
||||
TARGET libclementine-remote
|
||||
PROTOS ${MESSAGES}
|
||||
)
|
||||
|
||||
set_property(
|
||||
TARGET libclementine-remote
|
||||
PROPERTY CXX_STANDARD 17
|
||||
)
|
||||
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
list (SORT _variableNames)
|
||||
foreach (_variableName ${_variableNames})
|
||||
message(STATUS "${_variableName}=${${_variableName}}")
|
||||
endforeach()
|
||||
|
||||
target_link_libraries(libclementine-remote
|
||||
${PROTOBUF_LIBRARY}
|
||||
protobuf::libprotobuf
|
||||
libclementine-common
|
||||
)
|
||||
|
||||
|
@ -28,16 +28,24 @@ optional_source(HAVE_GOOGLE_DRIVE
|
||||
|
||||
qt5_wrap_cpp(MOC ${HEADERS})
|
||||
|
||||
protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES})
|
||||
|
||||
add_library(libclementine-tagreader STATIC
|
||||
${PROTO_SOURCES}
|
||||
${SOURCES}
|
||||
${MOC}
|
||||
)
|
||||
|
||||
protobuf_generate(
|
||||
LANGUAGE cpp
|
||||
TARGET libclementine-tagreader
|
||||
PROTOS ${MESSAGES}
|
||||
)
|
||||
|
||||
set_property(
|
||||
TARGET libclementine-tagreader
|
||||
PROPERTY CXX_STANDARD 17
|
||||
)
|
||||
|
||||
target_link_libraries(libclementine-tagreader
|
||||
${PROTOBUF_LIBRARY}
|
||||
protobuf::libprotobuf
|
||||
libclementine-common
|
||||
)
|
||||
|
||||
|
@ -1244,6 +1244,11 @@ add_library(clementine_lib STATIC
|
||||
${OTHER_UIC_SOURCES}
|
||||
)
|
||||
|
||||
set_property(
|
||||
TARGET clementine_lib
|
||||
PROPERTY CXX_STANDARD 17
|
||||
)
|
||||
|
||||
target_link_libraries(clementine_lib
|
||||
libclementine-common
|
||||
libclementine-tagreader
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include "core/song.h"
|
||||
|
||||
class TranscoderPreset;
|
||||
struct TranscoderPreset;
|
||||
|
||||
class OrganiseFormat {
|
||||
public:
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "core/closure.h"
|
||||
#include "core/network.h"
|
||||
|
||||
using std::mem_fun;
|
||||
using std::mem_fn;
|
||||
|
||||
namespace {
|
||||
|
||||
@ -89,7 +89,7 @@ void MusicbrainzCoverProvider::ReleaseSearchFinished(QNetworkReply* reply,
|
||||
void MusicbrainzCoverProvider::ImageCheckFinished(int id) {
|
||||
QList<QNetworkReply*> replies = image_checks_.values(id);
|
||||
int finished_count = std::count_if(replies.constBegin(), replies.constEnd(),
|
||||
mem_fun(&QNetworkReply::isFinished));
|
||||
mem_fn(&QNetworkReply::isFinished));
|
||||
if (finished_count == replies.size()) {
|
||||
QString cover_name = cover_names_.take(id);
|
||||
QList<CoverSearchResult> results;
|
||||
|
@ -17,11 +17,13 @@
|
||||
|
||||
#include "globalsearch.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <random>
|
||||
|
||||
#include <QSettings>
|
||||
#include <QStringBuilder>
|
||||
#include <QTimerEvent>
|
||||
#include <QUrl>
|
||||
#include <algorithm>
|
||||
|
||||
#include "core/application.h"
|
||||
#include "core/logging.h"
|
||||
@ -371,7 +373,9 @@ QStringList GlobalSearch::GetSuggestions(int count) {
|
||||
}
|
||||
|
||||
// Randomize the suggestions
|
||||
std::random_shuffle(ret.begin(), ret.end());
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
std::shuffle(ret.begin(), ret.end(), g);
|
||||
|
||||
// Only return the first count
|
||||
while (ret.length() > count) {
|
||||
|
@ -17,6 +17,12 @@
|
||||
|
||||
#include "playlist.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <random>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QBuffer>
|
||||
#include <QCoreApplication>
|
||||
@ -29,10 +35,6 @@
|
||||
#include <QUndoStack>
|
||||
#include <QtConcurrentRun>
|
||||
#include <QtDebug>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
#include <QRandomGenerator>
|
||||
@ -2079,6 +2081,8 @@ void Playlist::ReshuffleIndices() {
|
||||
if (current_virtual_index_ != -1)
|
||||
std::advance(begin, current_virtual_index_ + 1);
|
||||
|
||||
std::random_device rd;
|
||||
|
||||
switch (playlist_sequence_->shuffle_mode()) {
|
||||
case PlaylistSequence::Shuffle_Off:
|
||||
// Handled above.
|
||||
@ -2086,7 +2090,7 @@ void Playlist::ReshuffleIndices() {
|
||||
|
||||
case PlaylistSequence::Shuffle_All:
|
||||
case PlaylistSequence::Shuffle_InsideAlbum:
|
||||
std::random_shuffle(begin, end);
|
||||
std::shuffle(begin, end, std::mt19937(rd()));
|
||||
break;
|
||||
|
||||
case PlaylistSequence::Shuffle_Albums: {
|
||||
@ -2103,8 +2107,9 @@ void Playlist::ReshuffleIndices() {
|
||||
|
||||
// Shuffle them
|
||||
QStringList shuffled_album_keys = album_key_set.values();
|
||||
std::random_shuffle(shuffled_album_keys.begin(),
|
||||
shuffled_album_keys.end());
|
||||
std::shuffle(shuffled_album_keys.begin(),
|
||||
shuffled_album_keys.end(),
|
||||
std::mt19937(rd()));
|
||||
|
||||
// If the user is currently playing a song, force its album to be first
|
||||
// Or if the song was not playing but it was selected, force its album
|
||||
|
Loading…
x
Reference in New Issue
Block a user