Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / mozglue / baseprofiler / moz.build
blob2c75814e5ab93444aa8723652a7db39c02bdc622
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 # This is pretty much a copy from tools/profiler, cut down to exclude anything
8 # that cannot work in mozglue (because they are totally dependent on libxul-
9 # specific code).
10 # All exported headers now prefixed with "Base" to avoid #include name clashes.
12 if CONFIG["MOZ_GECKO_PROFILER"]:
13     DEFINES["IMPL_MFBT"] = True
14     EXPORTS += [
15         "public/BaseProfilingStack.h",
16     ]
17     UNIFIED_SOURCES += [
18         "core/PageInformation.cpp",
19         "core/platform.cpp",
20         "core/ProfileBuffer.cpp",
21         "core/ProfileBufferEntry.cpp",
22         "core/ProfiledThreadData.cpp",
23         "core/ProfileJSONWriter.cpp",
24         "core/ProfilerBacktrace.cpp",
25         "core/ProfilerMarkers.cpp",
26         "core/ProfilingCategory.cpp",
27         "core/ProfilingStack.cpp",
28         "core/RegisteredThread.cpp",
29     ]
31     if CONFIG["OS_TARGET"] in ("Android", "Linux", "FreeBSD"):
32         if CONFIG["TARGET_CPU"] in ("arm", "aarch64", "x86", "x86_64", "mips64"):
33             UNIFIED_SOURCES += [
34                 "lul/AutoObjectMapper.cpp",
35                 "lul/LulCommon.cpp",
36                 "lul/LulDwarf.cpp",
37                 "lul/LulDwarfSummariser.cpp",
38                 "lul/LulElf.cpp",
39                 "lul/LulMain.cpp",
40                 "lul/platform-linux-lul.cpp",
41             ]
42         # These files cannot be built in unified mode because of name clashes with mozglue headers on Android.
43         SOURCES += [
44             "core/shared-libraries-linux.cc",
45         ]
46         if CONFIG["TARGET_CPU"] == "arm" and CONFIG["OS_TARGET"] != "FreeBSD":
47             SOURCES += [
48                 "core/EHABIStackWalk.cpp",
49             ]
50     elif CONFIG["OS_TARGET"] == "Darwin":
51         UNIFIED_SOURCES += [
52             "core/shared-libraries-macos.cc",
53         ]
54     elif CONFIG["OS_TARGET"] == "WINNT":
55         SOURCES += [
56             "core/shared-libraries-win32.cc",
57         ]
59     LOCAL_INCLUDES += [
60         "/mozglue/baseprofiler/core/",
61         "/mozglue/linker",
62     ]
64     if CONFIG["OS_TARGET"] == "Android":
65         DEFINES["ANDROID_NDK_MAJOR_VERSION"] = CONFIG["ANDROID_NDK_MAJOR_VERSION"]
66         DEFINES["ANDROID_NDK_MINOR_VERSION"] = CONFIG["ANDROID_NDK_MINOR_VERSION"]
68 GeneratedFile(
69     "public/ProfilingCategoryList.h",
70     script="build/generate_profiling_categories.py",
71     entry_point="generate_macro_header",
72     inputs=["build/profiling_categories.yaml"],
75 EXPORTS += [
76     "!public/ProfilingCategoryList.h",
77     "public/BaseProfiler.h",
78     "public/BaseProfilerSharedLibraries.h",
79     "public/BaseProfilingCategory.h",
82 EXPORTS.mozilla += [
83     "public/BaseAndGeckoProfilerDetail.h",
84     "public/BaseProfileJSONWriter.h",
85     "public/BaseProfilerCounts.h",
86     "public/BaseProfilerDetail.h",
87     "public/BaseProfilerLabels.h",
88     "public/BaseProfilerMarkers.h",
89     "public/BaseProfilerMarkersDetail.h",
90     "public/BaseProfilerMarkersPrerequisites.h",
91     "public/BaseProfilerMarkerTypes.h",
92     "public/BaseProfilerRAIIMacro.h",
93     "public/BaseProfilerState.h",
94     "public/BaseProfilerUtils.h",
95     "public/FailureLatch.h",
96     "public/leb128iterator.h",
97     "public/ModuloBuffer.h",
98     "public/PowerOfTwo.h",
99     "public/ProfileBufferChunk.h",
100     "public/ProfileBufferChunkManager.h",
101     "public/ProfileBufferChunkManagerSingle.h",
102     "public/ProfileBufferChunkManagerWithLocalLimit.h",
103     "public/ProfileBufferControlledChunkManager.h",
104     "public/ProfileBufferEntryKinds.h",
105     "public/ProfileBufferEntrySerialization.h",
106     "public/ProfileBufferIndex.h",
107     "public/ProfileChunkedBuffer.h",
108     "public/ProfileChunkedBufferDetail.h",
109     "public/ProfilerBufferSize.h",
110     "public/ProgressLogger.h",
111     "public/ProportionValue.h",
114 UNIFIED_SOURCES += [
115     "core/BaseAndGeckoProfilerDetail.cpp",
116     "core/ProfilerUtils.cpp",
119 if CONFIG["MOZ_VTUNE"]:
120     DEFINES["MOZ_VTUNE_INSTRUMENTATION"] = True
121     UNIFIED_SOURCES += [
122         "core/VTuneProfiler.cpp",
123     ]
125 FINAL_LIBRARY = "mozglue"
127 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
128     CXXFLAGS += [
129         "-Wno-ignored-qualifiers",  # due to use of breakpad headers
130     ]
132 with Files("**"):
133     BUG_COMPONENT = ("Core", "Gecko Profiler")