-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconanfile.py
More file actions
112 lines (95 loc) · 6.09 KB
/
Copy pathconanfile.py
File metadata and controls
112 lines (95 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools
from utils import GitRepository
import os
import shutil
class BreakpadConan(ConanFile):
name = "breakpad"
version = "20181304"
description = "Breakpad is a set of client and server components which implement a crash-reporting system."
url = "https://gitlab.com/ArsenStudio/ArsenEngine/dependencies/conan-{0}".format(name)
homepage = "https://chromium.googlesource.com/breakpad/breakpad/"
# Breakpad License
license = "BSD-3-Clause"
exports = ["LICENSE.md", "FindBREAKPAD.cmake", "patch/*"]
exports_sources = ["CMakeLists.txt"]
generators = "cmake"
settings = 'os', 'compiler', 'build_type', 'arch'
options = {
"shared": [True, False]
}
default_options = "shared=False"
source_subfolder = "source_subfolder"
build_subfolder = "build_subfolder"
commit = "9eac2058b70615519b2c4d8c6bdbfca1bd079e39"
def source(self):
GitRepository("https://chromium.googlesource.com/breakpad/breakpad",
commit=self.commit).get(self.source_subfolder)
if self.settings.os == 'Linux':
GitRepository("https://chromium.googlesource.com/linux-syscall-support",
commit="a89bf7903f3169e6bc7b8efc10a73a7571de21cf") \
.get(os.path.join(self.source_subfolder, "src/third_party/lss"))
def build(self):
absolute_source_subfolder = os.path.abspath(self.source_subfolder)
with tools.chdir(self.build_subfolder):
if self.settings.os == 'Macos':
arch = 'i386' if self.settings.arch == 'x86' else self.settings.arch
self.run(("xcodebuild -project {source_folder}/src/client/mac/Breakpad.xcodeproj -sdk macosx" +
" -target Breakpad ARCHS={archs} ONLY_ACTIVE_ARCH=YES -configuration {config}")
.format(source_folder=absolute_source_subfolder, archs=arch, config=self.settings.build_type))
elif self.settings.os == 'Windows':
tools.patch(patch_file="patch/common.gypi.patch", base_path=self.source_subfolder)
self.run("gyp --no-circular-check -D win_release_RuntimeLibrary=2 -D win_debug_RuntimeLibrary=3 " +
"{source_folder}/src/client/windows/breakpad_client.gyp"
.format(source_folder=absolute_source_subfolder))
msbuild = MSBuild(self)
sln_filepath = os.path.join(absolute_source_subfolder, "src/client/windows/")
msbuild.build(sln_filepath + "common.vcxproj")
msbuild.build(sln_filepath + "handler/exception_handler.vcxproj")
msbuild.build(sln_filepath + "crash_generation/crash_generation_client.vcxproj")
msbuild.build(sln_filepath + "crash_generation/crash_generation_server.vcxproj")
msbuild.build(sln_filepath + "sender/crash_report_sender.vcxproj")
elif self.settings.os == 'Linux':
env_build = AutoToolsBuildEnvironment(self)
env_build.configure(absolute_source_subfolder)
env_build.make()
def package(self):
self.copy(pattern="LICENSE", dst="licenses", src=self.source_subfolder)
self.copy("FindBREAKPAD.cmake", ".", ".")
self.copy('*.h', dst='include/common', src=self.source_subfolder + '/src/common')
if self.settings.os == 'Macos':
self.copy('*.h', dst='include/client/mac', src=self.source_subfolder + '/src/client/mac')
# self.copy doesn't preserve symbolic links
shutil.copytree('breakpad/src/client/mac/build/{0}/Breakpad.framework'.format(self.settings.build_type),
os.path.join(self.package_folder, 'lib', 'Breakpad.framework'), symlinks=True)
elif self.settings.os == 'Windows':
self.copy('*.h', dst='include/client/windows', src=self.source_subfolder + '/src/client/windows')
self.copy('*.h', dst='include/google_breakpad', src=self.source_subfolder + '/src/google_breakpad')
self.copy('*.lib', dst='lib', src=self.source_subfolder + '/src/client/windows/' + self.settings.build_type,
keep_path=False)
self.copy('*.lib', dst='lib',
src=self.source_subfolder + '/src/client/windows/handler/' + self.settings.build_type,
keep_path=False)
self.copy('*.lib', dst='lib',
src=self.source_subfolder + '/src/client/windows/crash_generation/' + self.settings.build_type,
keep_path=False)
self.copy('*.lib', dst='lib',
src=self.source_subfolder + '/src/client/windows/sender/' + self.settings.build_type,
keep_path=False)
self.copy('*.exe', dst='bin', src=self.source_subfolder + '/src/tools/windows/binaries')
elif self.settings.os == 'Linux':
self.copy("*.h", dst="include/client/linux", src=self.source_subfolder + "/src/client/linux")
self.copy("*.h", dst="include/google_breakpad/", src=self.source_subfolder + "/src/google_breakpad")
self.copy("*.h", dst="include/third_party/", src=self.source_subfolder + "/src/third_party")
self.copy("*.a", dst="lib", src="src/client/linux")
self.copy("microdump_stackwalk", dst="bin", src="src/processor/")
self.copy("minidump_dump", dst="bin", src="src/processor/")
self.copy("minidump_stackwalk", dst="bin", src="src/processor/")
self.copy("dump_syms", dst="bin", src="src/tools/linux/dump_syms/")
self.copy("core2md", dst="bin", src="src/tools/linux/core2md/")
self.copy("minidump-2-core", dst="bin", src="src/tools/linux/md2core/")
self.copy("minidump_upload", dst="bin", src="src/tools/linux/symupload/")
self.copy("sym_upload", dst="bin", src="src/tools/linux/symupload/")
def package_info(self):
if self.settings.os == 'Windows':
self.cpp_info.libs = ['breakpad']
self.env_info.path.append(os.path.join(self.package_folder, "bin"))