16 Commits

Author SHA1 Message Date
Pierre Kestener
812e64f6bb try to fix add_backward macro 2018-05-09 10:51:36 +02:00
François-Xavier Bourlet
54451bea98
Merge pull request #110 from jbakosi/cmake_append_dwarf
Make cmake append libs dwarf and elf
2018-05-07 11:02:58 -07:00
François-Xavier Bourlet
8c266823ca
Merge pull request #112 from jbakosi/export_definitions
Export each definition individually
2018-05-07 11:02:38 -07:00
Jozsef Bakosi
157253254c
Export each definition individually
This allows using each definition (resulting from BackwardConfig.cmake)
separately, e.g., in conjunction with cmake's configure_file() command
and thus can be defined in a cmake-generated source file before a build.

Example:

Config.h.in
===========
 #cmakedefine01 BACKWARD_HAS_UNWIND
 #cmakedefine01 BACKWARD_HAS_BACKTRACE
 #cmakedefine01 BACKWARD_HAS_BACKTRACE_SYMBOL
 #cmakedefine01 BACKWARD_HAS_DW
 #cmakedefine01 BACKWARD_HAS_BFD
 #cmakedefine01 BACKWARD_HAS_DWARF

CMakeLists.txt:
===============
 include(BackwardConfig)
 configure_file( "${PROJECT_SOURCE_DIR}/Config.h.in"
                 "${PROJECT_BINARY_DIR}/Config.h" )

SomeProjectFile.C:
==================
 #include "Config.h"      // generated by cmake based on Config.h.in
 #include "backward.hpp"  // backward-cpp now configured based on BackwardConfig.cmake

 using namespace backward;
 StackTrace st; st.load_here(32);
 Printer p; p.print(st);
2018-05-06 10:18:48 -06:00
Jozsef Bakosi
dd57d9ed6d
Find libdwarf.h on debian
Debian installs libdwarf.h at /usr/include/libdwarf/. This change
enables cmake finding this header on debian.
2018-05-06 10:04:21 -06:00
Jozsef Bakosi
6717b69917
Make cmake append libs dwarf and elf
Without this they are not correctly included in BACKWARD_LIBRARIES even
when they are found.
2018-05-06 09:59:23 -06:00
François-Xavier Bourlet
c660fb9ce6
Merge pull request #107 from BotellaA/master
BackwardConfig whithout third party libraries
2018-05-05 07:55:27 -07:00
Pedro Navarro
2ba1296b5f libdwarf/libelf implementation 2018-05-01 12:02:59 -07:00
Arnaud Botella
bd7423d2a3 Edit config 2018-03-09 14:45:23 +01:00
Pierre Kestener
2e8dbeea62 fix cmake macro add_backward; just use variable BACKWARD_INCLUDE_DIRS instead of _BACKWARD_INCLUDE_DIRS 2017-11-14 15:59:29 +01:00
Manu343726
bfbd1a2047 Simplify setup of backward include dirs. Fixes #77 2017-11-01 10:36:48 +00:00
Kevin Funk
fe032a1345 backward-cpp: Make sure to properly link against bfd.a
On some distributions, libbfd is only available as static library. E.g.
on OpenSuse Leap 42.2, there are these two files:
  libbfd.a
  libbfd-2.28-system.so

backward-cpp, when attempting to link to bfd, will select the static
library and fail b/c there are undefined references to symbols from
libiberty/libz:
```
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libbfd.a(elflink.o):
In function `elf_link_add_object_symbols':
/home/abuild/rpmbuild/BUILD/binutils-2.26.1/build-dir/bfd/../../bfd/elflink.c:4733:
undefined reference to `objalloc_free_block'
/home/abuild/rpmbuild/BUILD/binutils-2.26.1/build-dir/bfd/../../bfd/elflink.c:5027:
undefined reference to `_sch_istable'
...
```

After this patch we also link against the direct dependencies of libbfd.a, namely libiberty and libz

Also see: https://github.com/KDAB/GammaRay/issues/386
2017-07-19 16:18:33 +02:00
François-Xavier Bourlet
6ae8564fbd enable tests that somebody thought it was a good idea to permanently disable. 2017-03-15 17:32:15 -07:00
Edison Gustavo Muenz
e8b8b5b2ec Prevent that the cmake variable BACKWARD_INCLUDE_DIRS be infinitely appended on successive cmake runs 2016-11-17 19:15:44 -02:00
Edison Gustavo Muenz
d242b6db4c Don't use find_package() in CMakeLists.txt since it does not make sense 2016-11-17 18:22:56 -02:00
Edison Gustavo Muenz
8c569af941 Add support to find_package(Backward) 2016-11-17 17:15:47 -02:00