-
Notifications
You must be signed in to change notification settings - Fork 24
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
Qt toolchain #29
base: master
Are you sure you want to change the base?
Qt toolchain #29
Conversation
Until now the path detected was for the includes, it was assuming that on Linux the Qt binaries are in the path and that the libraries are part of the system libraries. This makes clear that we are only using the include path and this is the first step to implement Qt rules as a toolchain. For the moment we print the folders for include, lib, and binary that are detected and this will later be part of the toolchain.
# If QT_DIR is defined and it exists, we consider that it is a standalone installation | ||
# Only in the case that is linux and QT_DIR is not defined it is considerd a none standalone | ||
# installation | ||
qt_dir_path = _get_env_var(repository_ctx, "QT_DIR", None) |
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.
Is there a reason to not use https://docs.bazel.build/versions/main/skylark/lib/dict.html#get ? It is available at least from 1.0 onward.
Because this uses QT_DIR
, I think repository_rule()
down below should set environ = ["QT_DIR"]
https://docs.bazel.build/versions/main/skylark/lib/globals.html#repository_rule
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.
As it is right now you are right that get could be used. What happened is that the code evolved. Initially getting the variable was done in a case insensitive way this is why get could have not been used. This should be redone and make clear what behavior is wanted, here the full discussion: #17 (comment)
I took the liberty to adapt this a little to our use-case at work. This is stripped down to suit our needs, but I am happy to collaborate on this and help with this PR.
PS: thank you @limdor, https://github.com/limdor/bazel-examples/tree/master/linux_toolchain helped tremendously! |
And just for someone else to be able to find it: https://github.com/qt/qtbase/blob/dev/src/tools/rcc/rcc.cpp#L237 One should set |
qt_prefix = qt_dir_path | ||
qt_includes = qt_prefix + "/include" | ||
qt_libs = qt_prefix + "/lib" | ||
qt_bins = qt_prefix + "/bin" |
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.
hello, curious about this part, how can we pass bin path to qt_toolchain rule to get moc, rcc and uic path?
No description provided.