Commit e66fb34c authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Generalize include path for dwarf.h (#790)

Summary:
Do not assume `dwarf.h` is contained within a subdirectory called `libdwarf` during CMake configure.

See https://github.com/facebook/folly/issues/788 for more detailed info.
Fixes: #788.
Pull Request resolved: https://github.com/facebook/folly/pull/790

Reviewed By: andrewjcg

Differential Revision: D9094892

Pulled By: yfeldblum

fbshipit-source-id: 6b5faf000e5ff4f85b2b93e43d12a911eb05b5ab
parent dcb5a31e
find_path(LIBDWARF_INCLUDE_DIR NAMES libdwarf/dwarf.h)
find_path(LIBDWARF_INCLUDE_DIR NAMES dwarf.h)
mark_as_advanced(LIBDWARF_INCLUDE_DIR)
find_library(LIBDWARF_LIBRARY NAMES dwarf)
......
......@@ -128,7 +128,7 @@ endif()
find_package(LibDwarf)
list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS})
CHECK_INCLUDE_FILE_CXX(libdwarf/dwarf.h FOLLY_HAVE_LIBDWARF_DWARF_H)
CHECK_INCLUDE_FILE_CXX(dwarf.h FOLLY_HAVE_LIBDWARF_DWARF_H)
find_package(Libiberty)
list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES})
......
......@@ -18,11 +18,7 @@
#include <type_traits>
#if FOLLY_HAVE_LIBDWARF_DWARF_H
#include <libdwarf/dwarf.h>
#else
#include <dwarf.h> // @manual
#endif
#include <dwarf.h>
namespace folly {
namespace symbolizer {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment