blob: cebe559a7f6981e5a518f3eb210f3f78cc376da0 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001# Class to inherit when you want to build against Breakpad.
2# Apart from inheriting this class, you need to set BREAKPAD_BIN in
3# your recipe, and make sure that you link against libbreakpad_client.a.
4
5DEPENDS += "breakpad breakpad-native"
6
7CFLAGS += "-I${STAGING_DIR_TARGET}${includedir}/breakpad "
8CXXFLAGS += "-I${STAGING_DIR_TARGET}${includedir}/breakpad "
9
10BREAKPAD_BIN ?= ""
11
12python () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013 breakpad_bin = d.getVar("BREAKPAD_BIN")
Patrick Williamsb48b7b42016-08-17 15:04:38 -050014
15 if not breakpad_bin:
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016 PN = d.getVar("PN")
17 FILE = os.path.basename(d.getVar("FILE"))
Patrick Williamsb48b7b42016-08-17 15:04:38 -050018 bb.error("To build %s, see breakpad.bbclass for instructions on \
19 setting up your Breakpad configuration" % PN)
20 raise ValueError('BREAKPAD_BIN not defined in %s' % PN)
21}
22
23# Add creation of symbols here
24PACKAGE_PREPROCESS_FUNCS += "breakpad_package_preprocess"
25breakpad_package_preprocess () {
26 mkdir -p ${PKGD}/usr/share/breakpad-syms
27 find ${D} -name ${BREAKPAD_BIN} -exec sh -c "dump_syms {} > ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym" \;
Brad Bishop19323692019-04-05 15:28:33 -040028 HASH=$(head -n1 ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym | rev | cut -d ' ' -f2 | rev)
29 mkdir -p ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH}
30 mv ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH}
Patrick Williamsb48b7b42016-08-17 15:04:38 -050031}
32
33PACKAGES =+ "${PN}-breakpad"
34
35FILES_${PN}-breakpad = "/usr/share/breakpad-syms"
36