summaryrefslogtreecommitdiffstats
blob: 142634bc288530ade903f8b8d4b62ec8afeaa82b (plain)
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
Import("env")

# Currently disabling breakpad for all platforms except windows
if env["PLATFORM"] == "win32" :

################################################################################
# Module flags
################################################################################

	if env["SCONS_STAGE"] == "flags" :
		env["HAVE_BREAKPAD"] = True
		env["BREAKPAD_FLAGS"] = {
				"CPPPATH": [env.Dir("src")],
				"CPPFLAGS": [],
				"LIBPATH": [env.Dir(".")],
				"LIBS": ["Swift_BreakPad"]
			}

################################################################################
# Build
################################################################################

	if env["SCONS_STAGE"] == "build" :
		myenv = env.Clone()
		myenv.Replace(CXXFLAGS = [flag for flag in env["CXXFLAGS"] if not flag.startswith("-W")])
		myenv.Append(CPPPATH = ["src"])

		lib_sources = []
		dumpsyms_sources = []
		common_sources = []
		if myenv["PLATFORM"] == "win32" :
			myenv.Append(CPPDEFINES = ["UNICODE"])
			lib_sources += [
				"src/client/windows/handler/exception_handler.cc",
				"src/client/windows/crash_generation/crash_generation_client.cc",
				"src/common/windows/guid_string.cc",
			]

		if myenv["PLATFORM"] == "darwin" or myenv["PLATFORM"] == "linux" :
			lib_sources += [
			]
			common_sources += [
				"src/common/md5.cc",
			]
		
		if myenv["PLATFORM"] == "darwin" :
			myenv.Append(CPPDEFINES = ["HAVE_MACH_O_NLIST_H"])
			lib_sources += [
				"src/client/mac/handler/exception_handler.cc",
				"src/client/mac/handler/minidump_generator.cc",
				"src/client/mac/handler/dynamic_images.cc",
				"src/client/mac/handler/breakpad_nlist_64.cc",
				"src/client/mac/crash_generation/crash_generation_client.cc",
				"src/common/mac/MachIPC.mm",
				"src/common/mac/string_utilities.cc",
				"src/common/mac/bootstrap_compat.cc",
				"src/client/minidump_file_writer.cc",
				"src/common/string_conversion.cc",
				"src/common/convert_UTF.c",
			]
			common_sources += [
				"src/common/mac/macho_id.cc",
				"src/common/mac/macho_walker.cc",
				"src/common/mac/file_id.cc",
				"src/common/mac/macho_utilities.cc",
			]
			dumpsyms_sources += [
				"src/tools/mac/dump_syms/dump_syms_tool.mm",
				"src/common/mac/dump_syms.mm",
				"src/common/mac/macho_reader.cc",
				"src/common/dwarf/bytereader.cc",
				"src/common/dwarf/dwarf2reader.cc",
				"src/common/dwarf/dwarf2diehandler.cc",
				"src/common/dwarf_line_to_module.cc",
				"src/common/dwarf_cfi_to_module.cc",
				"src/common/dwarf_cu_to_module.cc",
				"src/common/stabs_to_module.cc",
				"src/common/stabs_reader.cc",
				"src/common/module.cc",
				"src/common/language.cc",
			]

		if myenv["PLATFORM"] == "linux" :
			dumpsyms_sources += ["src/tools/linux/dump_syms/dump_syms.cc"]

		common_objects = myenv.StaticObject(common_sources)

		myenv.StaticLibrary("Swift_BreakPad", lib_sources + common_objects)

		#if myenv["PLATFORM"] == "darwin" or myenv["PLATFORM"] == "linux" :
		#	myenv.Program("dump_syms", dumpsyms_sources + common_objects)

else :

	if env["SCONS_STAGE"] == "flags" :
		env["HAVE_BREAKPAD"] = False
		env["BREAKPAD_FLAGS"] = {}