@@ -84,48 +84,58 @@ bitcode {
84
84
sourceSets {}
85
85
}
86
86
87
- module(" breakpad" ) {
88
- srcRoot.set(downloadBreakpad.flatMap { it.outputDirectory })
89
- val sources = listOf (
90
- " client/mac/crash_generation/crash_generation_client.cc" ,
91
- " client/mac/handler/breakpad_nlist_64.cc" ,
92
- " client/mac/handler/dynamic_images.cc" ,
93
- " client/mac/handler/exception_handler.cc" ,
94
- " client/mac/handler/minidump_generator.cc" ,
95
- " client/mac/handler/protected_memory_allocator.cc" ,
96
- " client/minidump_file_writer.cc" ,
97
- " common/mac/MachIPC.mm" ,
98
- " common/mac/arch_utilities.cc" ,
99
- " common/mac/file_id.cc" ,
100
- " common/mac/macho_id.cc" ,
101
- " common/mac/macho_utilities.cc" ,
102
- " common/mac/macho_walker.cc" ,
103
- " common/mac/string_utilities.cc" ,
104
- " common/mac/bootstrap_compat.cc" ,
105
- " common/convert_UTF.cc" ,
106
- " common/md5.cc" ,
107
- " common/string_conversion.cc" ,
108
- )
109
- sourceSets {
110
- main {
111
- inputFiles.from(srcRoot.dir(" src" ))
112
- inputFiles.setIncludes(sources)
113
- headersDirs.setFrom(project.layout.projectDirectory.dir(" src/breakpad/cpp" ))
114
- // Fix Gradle Configuration Cache: support this task being configured before breakpad sources are actually downloaded.
115
- compileTask.configure {
116
- inputFiles.setFrom(sources.map { breakpadLocationNoDependency.get().dir(" src" ).file(it) })
87
+ if (! project.hasProperty(" disableBreakpad" )) {
88
+ module(" breakpad" ) {
89
+ srcRoot.set(downloadBreakpad.flatMap { it.outputDirectory })
90
+ val sources = listOf (
91
+ " client/mac/crash_generation/crash_generation_client.cc" ,
92
+ " client/mac/handler/breakpad_nlist_64.cc" ,
93
+ " client/mac/handler/dynamic_images.cc" ,
94
+ " client/mac/handler/exception_handler.cc" ,
95
+ " client/mac/handler/minidump_generator.cc" ,
96
+ " client/mac/handler/protected_memory_allocator.cc" ,
97
+ " client/minidump_file_writer.cc" ,
98
+ " common/mac/MachIPC.mm" ,
99
+ " common/mac/arch_utilities.cc" ,
100
+ " common/mac/file_id.cc" ,
101
+ " common/mac/macho_id.cc" ,
102
+ " common/mac/macho_utilities.cc" ,
103
+ " common/mac/macho_walker.cc" ,
104
+ " common/mac/string_utilities.cc" ,
105
+ " common/mac/bootstrap_compat.cc" ,
106
+ " common/convert_UTF.cc" ,
107
+ " common/md5.cc" ,
108
+ " common/string_conversion.cc" ,
109
+ )
110
+ sourceSets {
111
+ main {
112
+ inputFiles.from(srcRoot.dir(" src" ))
113
+ inputFiles.setIncludes(sources)
114
+ headersDirs.setFrom(project.layout.projectDirectory.dir(" src/breakpad/cpp" ))
115
+ // Fix Gradle Configuration Cache: support this task being configured before breakpad sources are actually downloaded.
116
+ compileTask.configure {
117
+ inputFiles.setFrom(sources.map { breakpadLocationNoDependency.get().dir(" src" ).file(it) })
118
+ }
117
119
}
118
120
}
121
+ // Make sure breakpad sources are downloaded when building the corresponding compilation database entry
122
+ dependencies.add(downloadBreakpad)
123
+ compilerArgs.set(listOf (
124
+ " -std=c++17" ,
125
+ " -DHAVE_MACH_O_NLIST_H" ,
126
+ " -DHAVE_CONFIG_H" ,
127
+ ))
128
+
129
+ onlyIf { it.family == Family .OSX }
130
+ }
131
+ } else {
132
+ // Compiler expects breakpad.bc file. Let's give it an empty one.
133
+ module(" breakpad" ) {
134
+ srcRoot.set(project.layout.projectDirectory.dir(" src/breakpad_stubs" ))
135
+ sourceSets {
136
+ main {}
137
+ }
119
138
}
120
- // Make sure breakpad sources are downloaded when building the corresponding compilation database entry
121
- dependencies.add(downloadBreakpad)
122
- compilerArgs.set(listOf (
123
- " -std=c++17" ,
124
- " -DHAVE_MACH_O_NLIST_H" ,
125
- " -DHAVE_CONFIG_H" ,
126
- ))
127
-
128
- onlyIf { it.family == Family .OSX }
129
139
}
130
140
131
141
module(" libbacktrace" ) {
@@ -458,20 +468,29 @@ bitcode {
458
468
}
459
469
}
460
470
461
- module(" impl_crashHandler" ) {
462
- srcRoot.set(layout.projectDirectory.dir(" src/crashHandler/impl" ))
463
- // Cannot use output of `downloadBreakpad` to support Gradle Configuration Cache working before `downloadBreakpad`
464
- // actually had a chance to run.
465
- headersDirs.from(" src/main/cpp" , " src/breakpad/cpp" , breakpadLocationNoDependency.get().dir(" src" ))
466
- sourceSets {
467
- main {
468
- // This task depends on breakpad headers being present.
469
- compileTask.configure {
470
- dependsOn(downloadBreakpad)
471
+ if (! project.hasProperty(" disableBreakpad" )) {
472
+ module(" impl_crashHandler" ) {
473
+ srcRoot.set(layout.projectDirectory.dir(" src/crashHandler/impl" ))
474
+ // Cannot use output of `downloadBreakpad` to support Gradle Configuration Cache working before `downloadBreakpad`
475
+ // actually had a chance to run.
476
+ headersDirs.from(" src/main/cpp" , " src/breakpad/cpp" , breakpadLocationNoDependency.get().dir(" src" ))
477
+ sourceSets {
478
+ main {
479
+ // This task depends on breakpad headers being present.
480
+ compileTask.configure {
481
+ dependsOn(downloadBreakpad)
482
+ }
471
483
}
472
484
}
485
+ onlyIf { it.family == Family .OSX }
486
+ }
487
+ } else {
488
+ module(" impl_crashHandler" ) {
489
+ srcRoot.set(layout.projectDirectory.dir(" src/crashHandler/noop" ))
490
+ sourceSets {
491
+ main {}
492
+ }
473
493
}
474
- onlyIf { it.family == Family .OSX }
475
494
}
476
495
477
496
module(" noop_crashHandler" ) {
0 commit comments