-
Notifications
You must be signed in to change notification settings - Fork 228
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
Add support for CMake #12
Comments
This is not something I expect to work on myself. |
@ArekPiekar what are some of the use cases that you have in mind? I can take a stab at contributing CMake rules, but without knowing how people embed libbacktrace it's hard to know how to set things up. |
@thanm I would like to use it together with Boost.Stacktrace, a library for printing stack traces on demand or at application crash. Libbacktrace is one of many backends that Boost.Stacktrace supports, but this one works great for POSIX platforms and MinGW/MinGW-w64. It recently started working properly in Msys2 environment, so it would make sense to make the library easier for consuming. Personally I would like to add it as Git submodule in my project and then in CMake use add_subdirectory(), include_directories() and target_link_libraries() with it. But if it gets packaged in Conan, Msys2 repository and/or Ubuntu one, I would rather get it from there and use find_package(). Thanks for the offer and let me know if you need more info. |
Hi there, I also need CMake for my infrastructure and I'm willing to contribute CMakeLists.txt file which I'm working on right now. It's kinda incomplete since I've cheated and used automake to generate backtrace-supported.h. I'm a noob when it comes to autotools, so can you guide me how backtrace-supported.h is created, so that I can recreate same behavior in CMake? |
+1 for cmake script, it's convenient than auto tools, especaily on windows |
There is a bug, on Windows 10, which disallows to track the path of libbacktrace, during CMake's execution:
The above tells me that I have to modify my list of args, for CMake - but I am not sure what should I pass. Ivan |
@ArekPiekarz , and would indeed would normally integrate this project with https://go.googlesource.com/gollvm/ , where libbacktrace appears to be a dependancy. Same for https://git-scm.com/book/en/v2/Git-Tools-Submodules and hierarchical relations, for the DevOps and version control. |
FWIW this works as a meson subproject with just this project('libbacktrace', 'c', version: '1.0.0',
meson_version : '>=0.56.0',
)
mod = import('unstable_external_project')
p = mod.add_project (
'configure',
configure_options: [
'--prefix=@PREFIX@',
'--libdir=@PREFIX@/@LIBDIR@',
'--includedir=@PREFIX@/@INCLUDEDIR@',
],
env: {
'CFLAGS': '-fPIC',
}
)
libbacktrace_dep = p.dependency('backtrace') |
That's interesting. |
Could anyone tell if it is possible to cross-compile libbacktrace, on Windows 10 host, to target x86_64 Linux? Considering Clang, as a compiler. |
If anyone is interested, I've partially ported the build to cmake.
Caveats:
|
hey @alex-tee see this issue for reference {EDIT}
|
CMake is one of the most popular portable build systems for C++. Adding support for it to libbacktrace would greatly simplify integration with other projects and increase the popularity of this library.
There is a standalone fork of libbacktrace with CMake support, but it hasn't been updated in a long time. - https://github.com/ErwanLegrand/libbacktrace. Perhaps it could be used as an inspiration for this project.
The text was updated successfully, but these errors were encountered: