Add CMake modules and build without vendored dependencies using vcpkg#228
Add CMake modules and build without vendored dependencies using vcpkg#228emabrey merged 14 commits intotenacityteam:masterfrom
Conversation
a7437c6 to
2dea5f4
Compare
|
There was a FindwxWidgets.cmake module in there that was interfering with |
|
src/KeyboardCapture.cpp has a |
a352f9e to
dfc535b
Compare
|
But how would this work on windows? Are you required to build with MSYS2/Cygwin/MinGW or need to use vcpkg? |
|
Use vcpkg for Windows and macOS. |
|
not strictly related to this pr, what does tenacity need glib for? It's the heck of a dependency which seems a bit odd for a c++ project |
|
Good question... also, why is Tenacity directly using GTK APIs if it uses wxWidgets?? |
|
audacity uses stuff beyond wxwidgets for some native platform support. For gtk (and win32 and macOS), audacity has a custom file dialog which uses native calls to set up file filters, among other things. There are other places where workarounds are in place, or custom OS functionality. |
|
😱 |
|
@falkTX do you know if the GTK APIs are GTK2 or 3? |
|
afaik it depends on the WxWidgets being in use. some time ago they made it be gtk3 compatible. |
So they're using the whole glib for something that can be easily done with native APIs? It's a couple of ifdefs at best |
|
Gtk uses glib, so on linux you cant escape that dependency. |
escaping it on windows and macos wouldn't be a bad idea. it's especially painful to compile it on windows. besides, on linux you just need to link to gtk |
|
It compiles! Now to get it to link... |
|
Woooo it builds on my machine with Fedora 34! I copied the FindGTK.cmake module from WebKitGTK and wrote little CMakeLists.txt's for portsmf which has no Fedora package and libnyquist. |
src/commands/ScriptCommandRelay.cpp
Outdated
There was a problem hiding this comment.
#including private headers of your vendored dependencies is a totally normal thing to do right???? 🙃
|
Please test building this. There is definitely more work to do to complete this and clean it up, but at least this is a proof of concept that this is a viable route forward. |
|
Tested this PR on an Arch build, and I've managed to successfully build Tenacity without Conan. 🎉 (build log, for anyone interested) One minor caveat, though: the Arch repositories have an outdated version of |
That was not built, only configured. |
Signed-off-by: Be <be@mixxx.org>
Signed-off-by: Be <be@mixxx.org>
Add `CXX_WARNINGS_SILENCE_DEFINES` variable. Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org> Signed-off-by: Be <be@mixxx.org>
Done. |
Signed-off-by: Be <be@mixxx.org>
Remove linking option containing erroneous reference to `z.lib`. Add `set` commands to provide documented `id3tag::id3tag` vars. Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org> Signed-off-by: Be <be@mixxx.org> Co-authored-by: Emily Mabrey <emabrey@tenacityaudio.org> Co-authored-by: Be <be@mixxx.org>
|
@Be-ing this appear to create a large increase in binary size, any idea why? |
The executable size has increased after this PR from 22MB to 361MB on Ubuntu |
|
Nothing is wrong with this PR in this regard, other than maybe the CI rules. The build defaults to CMAKE_BUILD_TYPE=Debug, and the CI workflows seem to set CMAKE_BUILD_TYPE=RelWithDebInfo. This ending up in a 300MB+ tenacity binary is expected when the debug information doesn't get split out into a separate -dbg or -debug package, which it probably isn't. The cmake build system looks great to me, but the CI build rules may need some tweaking, either going to Release build type or doing the plumbing to split out debuginfo into a separate package like proper distro packages would do. |
|
I disagree. I think we should keep using RelWithDebInfo on CI. It would be very hard to get backtraces from Windows and macOS users without debug info in our builds. Distro packages can set the CMake build mode themselves according to their policies. |
|
Quick question: is vcpkg (or your CMake logic calling it) clever enough to detect when dependencies are available? Audacity has logic to force the use of system-provided versions of its "vendored dependencies", it looks like you didn't keep that? Context: I'm the maintainer of the Audacity port in MacPorts, and wondering if I'm going to have to spend a lot of time (and not-yet grey hairs ;)) trying to get your build system to behave "the MacPorts way", or rather spend that time finding and patching out the bad bits from the original code... |
Nope, it isn't. There are only two ways to build, using only system packages or using only vcpkg |
|
Yes there is an option for that: https://vcpkg.io/en/docs/users/manifests.html#vcpkg_prefer_system_libs But I don't know why you would use vcpkg in a package for another package manager. vcpkg isn't even usable within most package managers because it requires a network connection. Downloads can be done ahead of time, but that's not really how it's intended to be used. |

Signed-off-by: Be be@mixxx.org
This branch replaces the brittle dependency finding code using Conan with CMake modules that work with both Linux distribution packages and packages from vcpkg. vcpkg is used automatically on Windows and macOS. It can be enabled on Linux by passing
-D VCPKG=ONto the CMake configuration command. Refer to the rewritten BUILDING.md document in this branch for details about how to build it.All vendored dependencies and the hacky CMakeLists.txt in the cmake-proxies directory for building them have been removed except for libnyquist because Tenacity has a function that mixes private symbols from libnyquist with wxString.
-sorSigned-off-by* (See: Contributing § DCO)* indicates required