-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt6 prepare #11863
Qt6 prepare #11863
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# This file is part of Mixxx, Digital DJ'ing software. | ||
# Copyright (C) 2001-2023 Mixxx Development Team | ||
# Distributed under the GNU General Public Licence (GPL) version 2 or any later | ||
# later version. See the LICENSE file for details. | ||
|
||
#[=======================================================================[.rst: | ||
FindSleef | ||
-------------- | ||
|
||
Finds the Sleef library. | ||
|
||
Imported Targets | ||
^^^^^^^^^^^^^^^^ | ||
|
||
This module provides the following imported targets, if found: | ||
|
||
``Sleef::sleef`` | ||
The Sleef library | ||
|
||
Result Variables | ||
^^^^^^^^^^^^^^^^ | ||
|
||
This will define the following variables: | ||
|
||
``Sleef_FOUND`` | ||
True if the system has the Sleef library. | ||
``Sleef_INCLUDE_DIRS`` | ||
Include directories needed to use Sleef. | ||
``Sleef_LIBRARIES`` | ||
Libraries needed to link to Sleef. | ||
``Sleef_DEFINITIONS`` | ||
Compile definitions needed to use Sleef. | ||
|
||
Cache Variables | ||
^^^^^^^^^^^^^^^ | ||
|
||
The following cache variables may also be set: | ||
|
||
``Sleef_INCLUDE_DIR`` | ||
The directory containing ``sleef.h``. | ||
``Sleef_LIBRARY`` | ||
The path to the Sleef library. | ||
|
||
#]=======================================================================] | ||
|
||
find_package(PkgConfig QUIET) | ||
if(PkgConfig_FOUND) | ||
pkg_check_modules(PC_Sleef QUIET sleef) | ||
endif() | ||
|
||
find_path(Sleef_INCLUDE_DIR | ||
NAMES sleef.h | ||
PATHS ${PC_sleef_INCLUDE_DIRS} | ||
DOC "Sleef include directory") | ||
mark_as_advanced(Sleef_INCLUDE_DIR) | ||
|
||
find_library(Sleef_LIBRARY | ||
NAMES ${PC_Sleef_LIBRARIES} | ||
PATHS ${PC_Sleef_LIBRARY_DIRS}) | ||
mark_as_advanced(Sleef_LIBRARY) | ||
|
||
if(DEFINED PC_Sleef_VERSION AND NOT PC_Sleef_VERSION STREQUAL "") | ||
set(Sleef_VERSION "${PC_Sleef_VERSION}") | ||
else() | ||
if (EXISTS "${sleef_INCLUDE_DIR}/sleef.h") | ||
file(READ "$sleef{SLEEF_INCLUDE_DIR}/sleef.h" SLEEF_FIND_HEADER_CONTENTS) | ||
|
||
set(SLEEF_MAJOR_PREFIX "#define SLEEF_VERSION_MAJOR ") | ||
set(SLEEF_MINOR_PREFIX "#define SLEEF_VERSION_MINOR ") | ||
set(SLEEF_PATCH_PREFIX "#define SLEEF_VERSION_PATCHLEVEL ") | ||
|
||
string(REGEX MATCH "${SLEEF_MAJOR_PREFIX}[0-9]+" | ||
SLEEF_MAJOR_VERSION "${SLEEF_FIND_HEADER_CONTENTS}") | ||
string(REPLACE "${SLEEF_MAJOR_PREFIX}" "" SLEEF_MAJOR_VERSION | ||
"${SLEEF_MAJOR_VERSION}") | ||
|
||
string(REGEX MATCH "${SLEEF_MINOR_PREFIX}[0-9]+" | ||
SLEEF_MINOR_VERSION "${SLEEF_FIND_HEADER_CONTENTS}") | ||
string(REPLACE "${SLEEF_MINOR_PREFIX}" "" SLEEF_MINOR_VERSION | ||
"${SLEEF_MINOR_VERSION}") | ||
|
||
string(REGEX MATCH "${SLEEF_PATCH_PREFIX}[0-9]+" | ||
SLEEF_SUBMINOR_VERSION "${SLEEF_FIND_HEADER_CONTENTS}") | ||
string(REPLACE "${SLEEF_PATCH_PREFIX}" "" SLEEF_SUBMINOR_VERSION | ||
"${SLEEF_SUBMINOR_VERSION}") | ||
|
||
set(Sleef_VERSION | ||
"${SLEEF_MAJOR_VERSION}.${SLEEF_MINOR_VERSION}.${SLEEF_SUBMINOR_VERSION}") | ||
endif() | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
Sleef | ||
REQUIRED_VARS Sleef_INCLUDE_DIR Sleef_LIBRARY | ||
VERSION_VAR Sleef_VERSION) | ||
|
||
if(Sleef_FOUND) | ||
set(Sleef_LIBRARIES "${Sleef_LIBRARY}") | ||
set(Sleef_INCLUDE_DIRS "${Sleef_INCLUDE_DIR}") | ||
set(Sleef_DEFINITIONS ${PC_Sleef_CFLAGS_OTHER}) | ||
|
||
if(NOT TARGET Sleef::sleef) | ||
add_library(Sleef::sleef UNKNOWN IMPORTED) | ||
set_target_properties(Sleef::sleef | ||
PROPERTIES | ||
IMPORTED_LOCATION "${Sleef_LIBRARY}" | ||
INTERFACE_COMPILE_OPTIONS "${PC_Sleef_CFLAGS_OTHER}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${Sleef_INCLUDE_DIR}" | ||
) | ||
endif() | ||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1381,7 +1381,7 @@ TrackPointer TrackDAO::getTrackById(TrackId trackId) const { | |
QString columnsStr; | ||
int columnsSize = 0; | ||
for (int i = 0; i < columnsCount; ++i) { | ||
columnsSize += qstrlen(columns[i].name) + 1; | ||
columnsSize += static_cast<int>(qstrlen(columns[i].name)) + 1; | ||
} | ||
columnsStr.reserve(columnsSize); | ||
Comment on lines
1382
to
1386
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would've preferred changing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that world be nice. However QT provides no common ground with qsizetype for QString.reserve(). So using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean, "no common ground"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need a cast anyway, because Qt6 uses std::ptrdifsize for reserve() |
||
for (int i = 0; i < columnsCount; ++i) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the error like if neither sleef nor fftw is found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubberband is linked one of it, which is the choice of the package provider. If the library is not found build will fail with a significant linker error.
I have no idea how to investigate which library is used to fail early.
We need to wait for the Rubberband CONFIG mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just detect if
!fftw_FOUND && !Sleef_FOUND
and error out early then? Sorry for the dumb questions, I'm not familiar enough with cmake. I'm just trying to wrap my head around it.