Skip to content
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

Use CMAKE_PROJECT_VERSION for URLs #3831

Merged
merged 3 commits into from
May 8, 2021
Merged

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented May 6, 2021

This replaces #3792 by using the existing MIXXX_VERSION_MAJOR and MIXXX_VERSION_MINOR compile definitions.

@daschuer I opened this PR because I'm not that good with explaining my ideas, and it's easier to grasp the idea when looking at code rather. This change is what I meant with my second point here: #3822 (comment)

@Holzhaus Holzhaus requested a review from daschuer May 6, 2021 10:24
@Holzhaus Holzhaus marked this pull request as draft May 6, 2021 10:26
@Holzhaus
Copy link
Member Author

Holzhaus commented May 6, 2021

Converted to draft for further discussion, because we first need to decide how we want to deal with the git describe --dirty situation. If we want to merge #3822, this would cause a bunch of merge conflicts which is unfair to @daschuer. If necessary, I can rebase after merging the dirty flag fix PR.

@daschuer
Copy link
Member

daschuer commented May 6, 2021

Thank you. This works for me.
How many files are rebuild when the version changes?
We can fix that by making a version.cpp.in or a defs_url.cpp.in that provides a set of getter functions.

@Holzhaus Holzhaus added this to the 2.3.0 milestone May 6, 2021
@Holzhaus
Copy link
Member Author

Holzhaus commented May 6, 2021

Thank you. This works for me.
How many files are rebuild when the version changes?

These files:

[ 14%] Building CXX object CMakeFiles/mixxx-lib.dir/src/control/controlobjectscript.cpp.o
[ 14%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controller.cpp.o
[ 14%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controllerengine.cpp.o
[ 14%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controllerenumerator.cpp.o
[ 14%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controllerinputmappingtablemodel.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controllermanager.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controllermappingtablemodel.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controlleroutputmappingtablemodel.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controllerpresetfilehandler.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controllerpresetinfo.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/controllerpresetinfoenumerator.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/dlgcontrollerlearning.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/dlgprefcontroller.cpp.o
[ 15%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/dlgprefcontrollers.cpp.o
[ 16%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/midi/midicontroller.cpp.o
[ 16%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/midi/midicontrollerpreset.cpp.o
[ 16%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/midi/midicontrollerpresetfilehandler.cpp.o
[ 16%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/midi/midienumerator.cpp.o
[ 16%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/midi/midioutputhandler.cpp.o
[ 16%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/midi/portmidicontroller.cpp.o
[ 17%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/midi/portmidienumerator.cpp.o
[ 17%] Building CXX object CMakeFiles/mixxx-lib.dir/src/dialog/dlgabout.cpp.o
[ 17%] Building CXX object CMakeFiles/mixxx-lib.dir/src/mixxx.cpp.o
[ 17%] Building CXX object CMakeFiles/mixxx-lib.dir/src/musicbrainz/web/musicbrainzrecordingstask.cpp.o
[ 17%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/broadcastprofile.cpp.o
[ 17%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/broadcastsettings.cpp.o
[ 18%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefbeats.cpp.o
[ 18%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefdeck.cpp.o
[ 18%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefeq.cpp.o
[ 18%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgpreferencepage.cpp.o
[ 18%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgpreferences.cpp.o
[ 19%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefinterface.cpp.o
[ 19%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefkey.cpp.o
[ 19%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgpreflibrary.cpp.o
[ 19%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefsound.cpp.o
[ 19%] Building CXX object CMakeFiles/mixxx-lib.dir/src/skin/legacyskinparser.cpp.o
[ 20%] Building CXX object CMakeFiles/mixxx-lib.dir/src/skin/skinloader.cpp.o
[ 21%] Building CXX object CMakeFiles/mixxx-lib.dir/src/util/cmdlineargs.cpp.o
[ 21%] Building CXX object CMakeFiles/mixxx-lib.dir/src/util/versionstore.cpp.o
[ 21%] Building CXX object CMakeFiles/mixxx-lib.dir/src/widget/wmainmenubar.cpp.o
[ 21%] Building CXX object CMakeFiles/mixxx-lib.dir/src/widget/wtracktableview.cpp.o
[ 21%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefbroadcast.cpp.o
[ 21%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefmodplug.cpp.o
[ 21%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/hid/hidcontroller.cpp.o
[ 21%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/hid/hidenumerator.cpp.o
[ 22%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/hid/hidcontrollerpreset.cpp.o
[ 22%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/hid/hidcontrollerpresetfilehandler.cpp.o
[ 22%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/bulk/bulkcontroller.cpp.o
[ 22%] Building CXX object CMakeFiles/mixxx-lib.dir/src/controllers/bulk/bulkenumerator.cpp.o
[ 22%] Building CXX object CMakeFiles/mixxx-lib.dir/src/preferences/dialog/dlgprefvinyl.cpp.o

However, we do not change the CMAKE_PROJECT_VERSION that often (we're talking about months). Therefore I consider this neglible.

We can fix that by making a version.cpp.in or a defs_url.cpp.in that provides a set of getter functions.

This would also move the URL construction into the runtime domain rather than compile time. I'm not worried about the performance impact (I'm pretty sure that's neglible), but it will mean we need some more refactoring which i'd like to avoid right now. It would also create more conflicts with #3047 (although that PR still has some issues that need to be solved).

@Holzhaus Holzhaus mentioned this pull request May 7, 2021
@Holzhaus Holzhaus marked this pull request as ready for review May 7, 2021 10:10
@Holzhaus
Copy link
Member Author

Holzhaus commented May 7, 2021

No idea why this displays as failed, the build works fine. Anyway, this also part of #3841.

@daschuer daschuer merged commit 0eb2b0e into mixxxdj:2.3 May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants