-
Notifications
You must be signed in to change notification settings - Fork 102
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
Cmake enhacement #80
Open
schnitzeltony
wants to merge
5
commits into
oKcerG:master
Choose a base branch
from
schnitzeltony:cmake-enhacement
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Cmake enhacement #80
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SortFilterProxyModel is an awesome piece of code and we use it in several projects. This is the reason for this patch introducing shared library support. By doing so we: * Save memory by using shared library - at least RAM when running multiple applications using SortFilterProxyModel * Save build time: SortFilterProxyModel is build once for all To remain compatible with previous behaviour user can select what to do by cmake options: BUILD_OBJECT_LIB: (Default ON): Same as before: Add sources to your project and build obj-files that can be linked to your binary. It was taken care that projects behaves same as before (tested) - no need for develepers to make changes in their project. BUILD_SHARED_LIB: Build and install a shared library so that other projects can use it. This is the way packagers prefer deploying code. Signed-off-by: Andreas Müller <[email protected]>
Now that SortFilterProxyModel can be build standalone, Qt-Creator creates CMake.user.. files once it configures SortFilterProxyModel. User configurations are nothing to be added to repository (accidentally) so add an entry in .gitignore. Signed-off-by: Andreas Müller <[email protected]>
This does not cause any change to build but it adds the headers to the file list of IDEs like qt-creator gives developers much easier access. Signed-off-by: Andreas Müller <[email protected]>
… --as-needed There are build environments that link their binaries with --as-needed for good reasons [1]. This causes trouble here too: The application linking against SortFilterProxyModel has no reference to a symbol within SortFilterProxyModel so the library will simply be skipped and not loaded at runtime causing: | qrc:/qml/FaFilter.qml:2:1: module "SortFilterProxyModel" is not installed Linker with --as-needed behave similar as linking against static libraries and Qt documatation [2] warns explicitly not to use Q_COREAPP_STARTUP_FUNCTION when linking against static libraries. To get around a stateless class SortFilterProxyModel (luckily this name was not used yet) was created, that just contains the static method registerQml(). To avoid multile calls on environemts that do not link with --as-needed all register functions ensure to be called once only by a variable wasRegistered. In the following patch Readme.md will updated and will recommend highly to call SortFilterProxyModel::registerQml() - who knows which environment your application will be build in? [1] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed [2] https://doc.qt.io/qt-5/qcoreapplication.html#Q_COREAPP_STARTUP_FUNCTION Signed-off-by: Andreas Müller <[email protected]>
Signed-off-by: Andreas Müller <[email protected]>
Ping? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SortFilterProxyModel is an awesome project. The only thing caused headaches to me should be fixed by this series.
Comments welcome