[breakpad] add support for Android triplets (#16401)

* [breakpad] add support for Android triplets

This changes vcpkg's custom CMakeLists.txt file for Breakpad so
that it correctly builds libbreakpad_client for Android. It
follows the same source file layout for Android as seen in the
./android/google_breakpad/Android.mk make file.

* [breakpad] update control file

* [breakpad] update versions

* [breakpad] fix for unordered_map in MSVC++ STL and libstdc++

* [breakpad] update versions

* [breakpad] fix to install libbreakpad on non-Android platforms

* [breakpad] update versions

* [breakpad] Read sources list from Android.mk

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
This commit is contained in:
Jesse Towner 2021-03-29 10:12:06 -07:00 committed by GitHub
parent cda58bef39
commit 170e44d327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 39 deletions

View File

@ -11,7 +11,6 @@ add_definitions(
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE
-D_LIBCPP_VERSION
)
set(CMAKE_DEBUG_POSTFIX d)
@ -20,43 +19,52 @@ string(COMPARE EQUAL "${CMAKE_BUILD_TYPE}" "Release" DEFAULT_INSTALL_HEADERS)
option(INSTALL_HEADERS "Install header files" ${DEFAULT_INSTALL_HEADERS})
# libbreakpad target
file(GLOB_RECURSE LIBBREAKPAD_SOURCES src/processor/*.cc)
if(WIN32)
list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX
"_unittest|synth_minidump|/tests|/testdata|/linux|/mac|/android|/solaris|microdump_stackwalk|minidump_dump|minidump_stackwalk")
elseif(APPLE)
list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX
"_unittest|synth_minidump|/tests|/testdata|/linux|/windows|/android|/solaris|microdump_stackwalk|minidump_dump|minidump_stackwalk")
else()
list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX
"_unittest|synth_minidump|/tests|/testdata|/mac|/windows|/android|/solaris|microdump_stackwalk|minidump_dump|minidump_stackwalk")
if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
file(GLOB_RECURSE LIBBREAKPAD_SOURCES src/processor/*.cc)
if(WIN32)
list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX
"_unittest|synth_minidump|/tests|/testdata|/linux|/mac|/android|/solaris|microdump_stackwalk|minidump_dump|minidump_stackwalk")
elseif(APPLE)
list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX
"_unittest|synth_minidump|/tests|/testdata|/linux|/windows|/android|/solaris|microdump_stackwalk|minidump_dump|minidump_stackwalk")
else()
list(FILTER LIBBREAKPAD_SOURCES EXCLUDE REGEX
"_unittest|synth_minidump|/tests|/testdata|/mac|/windows|/android|/solaris|microdump_stackwalk|minidump_dump|minidump_stackwalk")
endif()
find_library(LIBDISASM_LIB NAMES libdisasmd libdisasm)
add_library(libbreakpad ${LIBBREAKPAD_SOURCES})
target_link_libraries(libbreakpad PRIVATE ${LIBDISASM_LIB})
target_include_directories(libbreakpad
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>
)
set(TARGETS libbreakpad)
endif()
find_library(LIBDISASM_LIB NAMES libdisasmd libdisasm)
add_library(libbreakpad ${LIBBREAKPAD_SOURCES})
target_link_libraries(libbreakpad PRIVATE ${LIBDISASM_LIB})
target_include_directories(libbreakpad
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>
)
set(TARGETS libbreakpad)
if(WIN32)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/windows/*.cc src/common/windows/*.cc)
include_directories("$ENV{VSINSTALLDIR}/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)
list(APPEND LIBBREAKPAD_CLIENT_SOURCES src/common/mac/MachIPC.mm)
# libbreakpad_client target
if(CMAKE_SYSTEM_NAME STREQUAL Android)
file(READ "android/google_breakpad/Android.mk" android_mk)
string(REGEX MATCHALL "src/[^\n]*\\.cc" LIBBREAKPAD_CLIENT_SOURCES "${android_mk}")
else()
add_definitions(-DHAVE_A_OUT_H)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/linux/*.cc src/common/linux/*.cc)
if(WIN32)
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES src/client/windows/*.cc src/common/windows/*.cc)
include_directories("$ENV{VSINSTALLDIR}/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)
list(APPEND LIBBREAKPAD_CLIENT_SOURCES src/common/mac/MachIPC.mm)
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})
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 "/sender|/tests|/unittests|/testcases|_unittest|_test")
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")
@ -76,7 +84,9 @@ elseif(APPLE)
target_link_libraries(libbreakpad_client PRIVATE ${CoreFoundation_FRAMEWORK})
else()
find_library(PTHREAD_LIBRARIES pthread)
target_link_libraries(libbreakpad_client PRIVATE ${PTHREAD_LIBRARIES})
if(PTHREAD_LIBRARIES)
target_link_libraries(libbreakpad_client PRIVATE ${PTHREAD_LIBRARIES})
endif()
if (HAVE_GETCONTEXT)
target_compile_definitions(libbreakpad_client PRIVATE HAVE_GETCONTEXT=1)
endif()

View File

@ -1,6 +1,6 @@
Source: breakpad
Version: 2020-09-14
Port-Version: 1
Version: 2020-09-14
Port-Version: 2
Build-Depends: libdisasm
Homepage: https://github.com/google/breakpad
Description: a set of client and server components which implement a crash-reporting system.

View File

@ -0,0 +1,14 @@
diff --git a/src/common/unordered.h b/src/common/unordered.h
index c9cbd58..7743eda 100644
--- a/src/common/unordered.h
+++ b/src/common/unordered.h
@@ -46,7 +46,8 @@ struct unordered_map : public __gnu_cxx::hash_map<T, U, H> {};
template <class T, class H = __gnu_cxx::hash<T> >
struct unordered_set : public __gnu_cxx::hash_set<T, H> {};
-#elif defined(_LIBCPP_VERSION) // c++11
+#elif (__cplusplus >= 201103L) || defined(_LIBCPP_VERSION) || \
+ (defined(_MSC_VER) && (_MSC_VER >= 1800)) // c++11
#include <unordered_map>
#include <unordered_set>
using std::unordered_map;

View File

@ -8,9 +8,10 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix-unique_ptr.patch
fix-unordered_map.patch
)
if(VCPKG_HOST_IS_LINUX)
if(VCPKG_HOST_IS_LINUX OR VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID)
vcpkg_from_git(
OUT_SOURCE_PATH LSS_SOURCE_PATH
URL https://chromium.googlesource.com/linux-syscall-support

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "724ca1cc38bbb2414d1efe91f8a95353235ede58",
"version-string": "2020-09-14",
"port-version": 2
},
{
"git-tree": "e266c29cb65ac51e96422f0788dae07529f1f493",
"version-string": "2020-09-14",

View File

@ -1006,7 +1006,7 @@
},
"breakpad": {
"baseline": "2020-09-14",
"port-version": 1
"port-version": 2
},
"brigand": {
"baseline": "1.3.0",