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

How do you use backward with a library? #37

Closed
v0n0 opened this issue Aug 23, 2016 · 2 comments
Closed

How do you use backward with a library? #37

v0n0 opened this issue Aug 23, 2016 · 2 comments

Comments

@v0n0
Copy link

v0n0 commented Aug 23, 2016

Hi,

I have a project in which Python uses static C++ libraries. How do I include backward in the project? Do I have to include it in each CMake file for each library? An example would be great.

Thanks

@bombela
Copy link
Owner

bombela commented Aug 24, 2016

Hi,

You can build a single static libraries of backward-cpp and make sure you initialize it only once by linking all your lib togethers. Be wary that redirecting unix signals might not play along very well with python. You might want to test that carefully.

As long as you link everything together at once, you will have a single copy of the code statically shared. Note backward-cpp is in fact header only, and with modern LTO (link time optimization) I suspect there is not much to fiddle with. Only the piece of code that register signals handlers must run only once. And even if it where to run more than once, at the end of the day, this would still achieve the same effect because signals are process global anyway.

Best,
fx

@v0n0
Copy link
Author

v0n0 commented Aug 26, 2016

Thanks, I'll try that!

@v0n0 v0n0 closed this as completed Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants