-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconanfile.py
70 lines (63 loc) · 4.87 KB
/
conanfile.py
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
from conans import ConanFile, AutoToolsBuildEnvironment
import os, shutil
class BreakpadConan( ConanFile ):
name = 'breakpad'
version = '1.0.0'
license = 'https://chromium.googlesource.com/breakpad/breakpad/+/master/LICENSE'
url = 'https://github.com/shinichy/conan-breakpad'
settings = 'os', 'compiler', 'build_type', 'arch'
generators = 'cmake'
branch = 'chrome_58'
exports = ["FindBREAKPAD.cmake", "patch/*"]
def source( self ):
self.run('git clone https://chromium.googlesource.com/breakpad/breakpad --branch %s --depth 1' % self.branch)
if self.settings.os == 'Linux':
self.run('git clone https://chromium.googlesource.com/linux-syscall-support breakpad/src/third_party/lss')
def build( self ):
if self.settings.os == 'Macos':
arch = 'i386' if self.settings.arch == 'x86' else self.settings.arch
self.run( 'xcodebuild -project breakpad/src/client/mac/Breakpad.xcodeproj -sdk macosx -target Breakpad ARCHS=%s ONLY_ACTIVE_ARCH=YES -configuration %s' % (arch, self.settings.build_type) )
elif self.settings.os == 'Windows':
self.run( 'cd breakpad & C:\\msys64\\usr\\bin\\patch -p1 --binary -N < ..\\patch\\common.gypi.patch' )
self.run( 'gyp --no-circular-check -D win_release_RuntimeLibrary=2 -D win_debug_RuntimeLibrary=3 breakpad/src/client/windows/breakpad_client.gyp' )
self.run( 'MSBuild.exe /p:Configuration=%s /p:VisualStudioVersion=%s breakpad/src/client/windows/common.vcxproj' % ( self.settings.build_type, self.settings.compiler.version ) )
self.run( 'MSBuild.exe /p:Configuration=%s /p:VisualStudioVersion=%s /p:DisableSpecificWarnings="4091;2220" breakpad/src/client/windows/handler/exception_handler.vcxproj' % ( self.settings.build_type, self.settings.compiler.version ) )
self.run( 'MSBuild.exe /p:Configuration=%s /p:VisualStudioVersion=%s breakpad/src/client/windows/crash_generation/crash_generation_client.vcxproj' % ( self.settings.build_type, self.settings.compiler.version ))
self.run( 'MSBuild.exe /p:Configuration=%s /p:VisualStudioVersion=%s breakpad/src/client/windows/crash_generation/crash_generation_server.vcxproj' % ( self.settings.build_type, self.settings.compiler.version ))
self.run( 'MSBuild.exe /p:Configuration=%s /p:VisualStudioVersion=%s breakpad/src/client/windows/sender/crash_report_sender.vcxproj' % ( self.settings.build_type, self.settings.compiler.version ))
elif self.settings.os == 'Linux':
env_build = AutoToolsBuildEnvironment(self)
env_build.configure('breakpad/')
env_build.make()
def package( self ):
self.copy("FindBREAKPAD.cmake", ".", ".")
self.copy( '*.h', dst='include/common', src='breakpad/src/common' )
if self.settings.os == 'Macos':
self.copy( '*.h', dst='include/client/mac', src='breakpad/src/client/mac' )
# self.copy doesn't preserve symbolic links
shutil.copytree('breakpad/src/client/mac/build/%s/Breakpad.framework' % 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='breakpad/src/client/windows' )
self.copy( '*.h', dst='include/google_breakpad', src='breakpad/src/google_breakpad' )
self.copy( '*.lib', dst='lib', src='breakpad/src/client/windows/%s' % self.settings.build_type, keep_path=False )
self.copy( '*.lib', dst='lib', src='breakpad/src/client/windows/handler/%s' % self.settings.build_type, keep_path=False )
self.copy( '*.lib', dst='lib', src='breakpad/src/client/windows/crash_generation/%s' % self.settings.build_type, keep_path=False )
self.copy( '*.lib', dst='lib', src='breakpad/src/client/windows/sender/%s' % self.settings.build_type, keep_path=False )
self.copy( '*.exe', dst='bin', src='breakpad/src/tools/windows/binaries' )
elif self.settings.os == 'Linux':
self.copy("*.h", dst="include/client/linux", src="breakpad/src/client/linux")
self.copy("*.h", dst="include/google_breakpad/", src="breakpad/src/google_breakpad")
self.copy("*.h", dst="include/third_party/", src="breakpad/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"))