Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6 from FredrikAppelros/hunter-0.0.0-12ecff3-p2
Browse files Browse the repository at this point in the history
Find DIA SDK and export client library
  • Loading branch information
ruslo authored Apr 25, 2019
2 parents 615407c + 130b5c9 commit ef6137f
Show file tree
Hide file tree
Showing 5 changed files with 5,166 additions and 25 deletions.
63 changes: 38 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
cmake_minimum_required(VERSION 3.6)

include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.83.tar.gz"
SHA1 "12dec078717539eb7b03e6d2a17797cba9be9ba9"
)

project(breakpad)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")

set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(config_install_dir "lib/cmake/${PROJECT_NAME}")
set(include_install_dir "include")
Expand Down Expand Up @@ -186,34 +194,39 @@ add_definitions(
)

if(WIN32)
if(WIN32)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/windows/*.cc src/common/windows/*.cc)
include_directories("C:/Program Files (x86)/Microsoft Visual Studio 14.0/DIA SDK/include")
include_directories("C:/Program Files (x86)/Microsoft Visual Studio 12.0/DIA SDK/include")
elseif(APPLE)
add_definitions(-DHAVE_MACH_O_NLIST_H)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/mac/*.cc src/common/mac/*.cc)
else()
add_definitions(-DHAVE_A_OUT_H)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/linux/*.cc src/common/linux/*.cc)
endif()
file(GLOB LIBBREAKPAD_COMMON_SOURCES src/common/*.cc src/common/*.c src/client/*.cc)
list(APPEND LIBBREAKPAD_CLIENT_SOURCES ${LIBBREAKPAD_COMMON_SOURCES})
list(FILTER LIBBREAKPAD_CLIENT_SOURCES EXCLUDE REGEX "/tests|/unittests|_unittest")
if(WIN32)
list(FILTER LIBBREAKPAD_CLIENT_SOURCES EXCLUDE REGEX "language.cc|path_helper.cc|stabs_to_module.cc|stabs_reader.cc|minidump_file_writer.cc")
endif()
add_library(libbreakpad_client ${LIBBREAKPAD_CLIENT_SOURCES})
target_include_directories(libbreakpad_client
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${include_install_dir}/breakpad>
)

file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/windows/*.cc src/common/windows/*.cc)
find_package(DiaSDK)
include_directories("${DIASDK_INCLUDE_DIRS}")
elseif(APPLE)
add_definitions(-DHAVE_MACH_O_NLIST_H)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/mac/*.cc src/common/mac/*.cc)
else()
add_definitions(-DHAVE_A_OUT_H)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/linux/*.cc src/common/linux/*.cc)
endif()
file(GLOB LIBBREAKPAD_COMMON_SOURCES src/common/*.cc src/common/*.c src/client/*.cc)
list(APPEND LIBBREAKPAD_CLIENT_SOURCES ${LIBBREAKPAD_COMMON_SOURCES})
list(FILTER LIBBREAKPAD_CLIENT_SOURCES EXCLUDE REGEX "/tests|/unittests|_test.cc$|_unittest.cc$")
if(WIN32)
list(FILTER LIBBREAKPAD_CLIENT_SOURCES EXCLUDE REGEX "language.cc|path_helper.cc|stabs_to_module.cc|stabs_reader.cc|minidump_file_writer.cc")
endif()
add_library(libbreakpad_client ${LIBBREAKPAD_CLIENT_SOURCES})
target_include_directories(libbreakpad_client
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${include_install_dir}/breakpad>
)
if(NOT WIN32 AND NOT APPLE)
hunter_add_package(gflags)
hunter_add_package(glog)
find_package(gflags CONFIG REQUIRED)
find_package(glog CONFIG REQUIRED)
target_link_libraries(libbreakpad_client PUBLIC gflags glog::glog)
endif()


install(
TARGETS libbreakpad libdisasm
TARGETS libbreakpad libdisasm libbreakpad_client
EXPORT ${targets_export_name}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
Expand Down
Loading

0 comments on commit ef6137f

Please sign in to comment.