jeremy-rifkin / cpptrace

Simple, portable, and self-contained stacktrace library for C++11 and newer
MIT License
621 stars 64 forks source link

Add capability to choose libunwind as a setting in Conanfile #110

Closed yfinkelstein closed 4 months ago

yfinkelstein commented 4 months ago

Currently it's impossible to to choose libunwind (not the gcc one but stand-alone one - the one that's signal safe) through Conan. I had to patch Conanfile to achieve it:

 def generate(self):
        tc = CMakeToolchain(self)
        if is_msvc(self):
            tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self)
        if Version(self.version) >= Version("0.3.0"):
            tc.variables["CPPTRACE_USE_EXTERNAL_LIBDWARF"] = True
            tc.variables["CPPTRACE_UNWIND_WITH_LIBUNWIND"] = True
            tc.variables["CPPTRACE_CONAN"] = True
        else:
...

A lean way to do it is is probably to add it as an Option or maybe even a Setting.

jeremy-rifkin commented 4 months ago

Thanks for opening this, it would definitely be good for the conanfile to be able to support this better.