Thank you for the very useful library!
Few improvements:
- Better header hygiene
- Isolate `windows.h` to `.cpp` whenever possible
- Use `WIN32_LEAN_AND_MEAN`
- Remove unused headers
Tested on Windows with
```
cmake .. -DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_EXPORT_COMPILE_COMMANDS=1
-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="-ftime-trace -Wall -Wextra -Wpedantic
-Wno-ignored-attributes" -DCMAKE_COLOR_DIAGNOSTICS=1 -DCPPTRACE_BUILD_TESTING=1
-DCPPTRACE_BUILD_BENCHMARKING=0
```
There's a lot more that can be improved if you are interested.
---------
Co-authored-by: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com>
This PR adds a Findzstd.cmake script to cpptrace's install so that
`find_dependency(zstd)` can succeed on installations that don't include
zstdConfig.cmake/zstd-config.cmake.
The reason `find_dependency(zstd)` is needed in cpptrace's config,
despite `find_dependency(zstd)` also being in libdwarf's cmake and
cpptrace not needing zstd, is that libdwarf's cmake doesn't define
`zstd::libzstd_static` / `zstd::libzstd_shared` targets.
This should fix#112.
First thx for these very useful lib!
I encountered some issues when linking with `libcpptrace`. Typically,
here is the error I got:
```
/usr/bin/ld: lib/cpptrace/lib/libcpptrace.a(cpptrace.cpp.o): relocation R_X86_64_32S against symbol `_ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE@@GLIBCXX_3.4.21' can not be used when making a PIE object; recompile with -fPIE
```
I just added the `POSITION_INDEPENDENT_CODE ON` flag on the targets, and
now it works like a charm :-).