-
-
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
Add libdjinterop external project dependency #2932
Conversation
CMakeLists.txt
Outdated
# libdjinterop depends on zlib and sqlite3. | ||
# Mixxx already has a dependency on sqlite3, but not zlib, which we add now. | ||
find_package(ZLIB 1.2.8 REQUIRED) |
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.
This might be considered slightly fishy: we're linking statically to libdjinterop, but libdjinterop depends on SQLite3 and ZLib. It just so happens that Mixxx already has the SQLite3 dependency, but not ZLib.
Are there any concerns with encoding implicit knowledge of libdjinterop's dependencies here? I'm not aware of a better way with static build.
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.
@Holzhaus Opinions?
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.
I think this should be move to the FindDJInterop module. For the external project build, this can be taken care of in libdjinterop's own CMakeLists.txt.
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.
For the external project build, this can be taken care of in libdjinterop's own CMakeLists.txt.
The CMakeLists.txt file from libdjinterop already has a find_package(ZLIB 1.2.8 REQUIRED)
line. However, I was not able to get the dependencies of the external project to transfer through to mixxx-lib
(and search engines were not fruitful for me). Do you know of a way in CMake to do this?
Note: this line is only in the external project section: it isn't required if the library is found via FindDjInterop, as that would be linking to a shared library which already has the dependency explicit.
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.
I just noticed that the ChromaPrint dependency already does this (with FFTW), so at least the situation here is in line with the status quo.
fb83912
to
3bd92eb
Compare
You could adopt our workaround in util/optional.h to enable compatibility with macOS. The pre-standard version is missing some methods from final standard and might require some workarounds. |
Please rebase on (upstream) master. |
CMakeLists.txt
Outdated
# libdjinterop depends on zlib and sqlite3. | ||
# Mixxx already has a dependency on sqlite3, but not zlib, which we add now. | ||
find_package(ZLIB 1.2.8 REQUIRED) |
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.
@Holzhaus Opinions?
@uklotzde , I thought about this approach, but wanted to check: are there plans to upgrade the version of Apple LLVM on the build servers? If there are, I might prefer that rather than add workarounds for old compilers. |
Erm, it already is (at the time of writing) - did you see something to indicate that it wasn't? Thanks. |
6f5008c
to
b0a6b4c
Compare
We cannot update the CI build servers as long as we want to support older macOS releases. Please add the workaround if you want your library included in macOS builds. |
If cloned your branch locally and tried to rebase on master -> conflicts |
Sorry, I forgot to pull master. |
Add -DDJINTEROP=ON to Ubuntu/CMake travis and appveyor builds. Add shallow git clone.
b0a6b4c
to
0aa65b2
Compare
Raised xsco/libdjinterop#14 for the libdjinterop library. I'll focus on Linux builds for this PR and will enable it for Mixxx Mac builds in a later PR. |
CMakeLists.txt
Outdated
set(DJINTEROP_GIT_REPO_URL https://github.com/xsco/libdjinterop.git) | ||
set(DJINTEROP_GIT_TAG tags/0.11.0) | ||
set(DJINTEROP_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/lib/libdjinterop-install") | ||
if(DJINTEROP_MESON_BUILD) |
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.
Why do we need to support both build systems? If libdjinterop has a cmake build, let's just use that one. The user might not even have meson installed and custom build flags can't be passed to meson anyway with this implementation.
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.
Short bit of background: Meson has been the main build system for libdjinterop, based mainly on my personal preferences whilst developing the library, and the easier time with cross-platform dependency management. I originally added a CMake build on a "best efforts" basis with the idea that it would make it easier to integrate with Mixxx. As you note (and as written in a comment), the typical user compiling Mixxx may not even have Meson/Ninja installed.
So I have to think about whether I, as the libdjinterop maintainer, should support two build systems for the library. Given the current simplicity of the libdjinterop build, maybe I can make the CMake build "official".
Nonetheless, I am not about to go and deliberately break the CMake build (!), so I don't mind removing the conditional regardless.
CMakeLists.txt
Outdated
# libdjinterop depends on zlib and sqlite3. | ||
# Mixxx already has a dependency on sqlite3, but not zlib, which we add now. | ||
find_package(ZLIB 1.2.8 REQUIRED) |
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.
I think this should be move to the FindDJInterop module. For the external project build, this can be taken care of in libdjinterop's own CMakeLists.txt.
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.
Works fine, thanks!
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.
LGTM, thanks.
A re-run failed too. I might need some help with these AppVeyor VS errors - I can't see how these are connected to the commits in this PR. Example:
Any ideas? |
Strange. I'll push this branch to my personal AppVeyor account for testing. |
Test failures are probably caused by #2938 |
Please merge master to verify that the build succeeds now. |
Done, and the VS AppVeyor build now passes 😄. Unfortunately, the OSX Scons build failed after timing out! 🤦 Please could this be re-run for a (hopefully) clean bill of health? |
All green - ok to merge? Then I'll update PR #2753 . |
Huh? Shouldn't you merge this into #2753? This doesn't make sense in master on its own... |
@uklotzde okay, then go ahead |
LGTM |
Our build servers are not affected until we enable this option. Should be safe. |
This PR adds the libdjinterop library as an external project dependency to the CMake build system for Mixxx. It is a precursor to PR #2753 , which will add library export functionality using libdjinterop.
Notes:
std::optional<T>
(only experimental), which is in the public library headers.