-
Notifications
You must be signed in to change notification settings - Fork 709
Enable to build on systems lacking execinfo.h #7076
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
Conversation
|
I think it's better to use: |
|
@jonaski Thanks, I'll try that. |
|
@jonaski is that enough? |
| #include <QtGlobal> | ||
| #ifdef Q_OS_UNIX | ||
| #ifdef HAVE_BACKTRACE | ||
| #include <execinfo.h> |
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.
execinfo.h also may not be correct. FindBacktrace recommends generating a file that includes ${Backtrace_HEADER}
https://cmake.org/cmake/help/v3.0/module/FindBacktrace.html
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.
Yes, that's why I was asking... I went for the trivial change...
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.
Solved. I think.
The Q_OS_UNIX macro is inappropriate because many UNIX-like platforms may lack backtrace support in the libc. E.g.: Darwin / Mac OS X, Musl libc, OpenBSD, OpenIndiana.
| ) | ||
|
|
||
| find_package(Backtrace) | ||
| configure_file(core/conf_backtrace.h.in conf_backtrace.h) |
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 you should only do this if the package was found. Otherwise, Backtrace_HEADER won't be defined.
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.
what do you mean? the header file needs to be produced, always...
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.
also, the include is guarded by an ifdef...
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.
Oh yeah. I didn't notice that you had moved the ifdef.
The Q_OS_UNIX macro is inappropriate for detection because many UNIX-like
platforms may lack backtrace support in the libc. E.g.: Darwin / Mac OS X,
Musl libc, OpenBSD, OpenIndiana.