Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / mozglue / baseprofiler / moz.build
blobd7b3342f989b8508a2d9151aeed2dd99665ec481
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/BaseProfilerSharedLibraries.h",
16         "public/BaseProfilingStack.h",
17     ]
18     UNIFIED_SOURCES += [
19         "core/PageInformation.cpp",
20         "core/platform.cpp",
21         "core/ProfileBuffer.cpp",
22         "core/ProfileBufferEntry.cpp",
23         "core/ProfiledThreadData.cpp",
24         "core/ProfileJSONWriter.cpp",
25         "core/ProfilerBacktrace.cpp",
26         "core/ProfilerMarkers.cpp",
27         "core/ProfilingCategory.cpp",
28         "core/ProfilingStack.cpp",
29         "core/RegisteredThread.cpp",
30     ]
32     if CONFIG["OS_TARGET"] in ("Android", "Linux", "FreeBSD"):
33         if CONFIG["CPU_ARCH"] in ("arm", "aarch64", "x86", "x86_64", "mips64"):
34             UNIFIED_SOURCES += [
35                 "lul/AutoObjectMapper.cpp",
36                 "lul/LulCommon.cpp",
37                 "lul/LulDwarf.cpp",
38                 "lul/LulDwarfSummariser.cpp",
39                 "lul/LulElf.cpp",
40                 "lul/LulMain.cpp",
41                 "lul/platform-linux-lul.cpp",
42             ]
43         # These files cannot be built in unified mode because of name clashes with mozglue headers on Android.
44         SOURCES += [
45             "core/shared-libraries-linux.cc",
46         ]
47         if CONFIG["CPU_ARCH"] == "arm" and CONFIG["OS_TARGET"] != "FreeBSD":
48             SOURCES += [
49                 "core/EHABIStackWalk.cpp",
50             ]
51     elif CONFIG["OS_TARGET"] == "Darwin":
52         UNIFIED_SOURCES += [
53             "core/shared-libraries-macos.cc",
54         ]
55     elif CONFIG["OS_TARGET"] == "WINNT":
56         SOURCES += [
57             "core/shared-libraries-win32.cc",
58         ]
60     LOCAL_INCLUDES += [
61         "/mozglue/baseprofiler/core/",
62         "/mozglue/linker",
63     ]
65     if CONFIG["OS_TARGET"] == "Android":
66         DEFINES["ANDROID_NDK_MAJOR_VERSION"] = CONFIG["ANDROID_NDK_MAJOR_VERSION"]
67         DEFINES["ANDROID_NDK_MINOR_VERSION"] = CONFIG["ANDROID_NDK_MINOR_VERSION"]
69 GeneratedFile(
70     "public/ProfilingCategoryList.h",
71     script="build/generate_profiling_categories.py",
72     entry_point="generate_macro_header",
73     inputs=["build/profiling_categories.yaml"],
76 EXPORTS += [
77     "!public/ProfilingCategoryList.h",
78     "public/BaseProfiler.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/BlocksRingBuffer.h",
96     "public/FailureLatch.h",
97     "public/leb128iterator.h",
98     "public/ModuloBuffer.h",
99     "public/PowerOfTwo.h",
100     "public/ProfileBufferChunk.h",
101     "public/ProfileBufferChunkManager.h",
102     "public/ProfileBufferChunkManagerSingle.h",
103     "public/ProfileBufferChunkManagerWithLocalLimit.h",
104     "public/ProfileBufferControlledChunkManager.h",
105     "public/ProfileBufferEntryKinds.h",
106     "public/ProfileBufferEntrySerialization.h",
107     "public/ProfileBufferIndex.h",
108     "public/ProfileChunkedBuffer.h",
109     "public/ProfileChunkedBufferDetail.h",
110     "public/ProfilerBufferSize.h",
111     "public/ProgressLogger.h",
112     "public/ProportionValue.h",
115 UNIFIED_SOURCES += [
116     "core/BaseAndGeckoProfilerDetail.cpp",
117     "core/ProfilerUtils.cpp",
120 if CONFIG["MOZ_VTUNE"]:
121     DEFINES["MOZ_VTUNE_INSTRUMENTATION"] = True
122     UNIFIED_SOURCES += [
123         "core/VTuneProfiler.cpp",
124     ]
126 FINAL_LIBRARY = "mozglue"
128 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
129     CXXFLAGS += [
130         "-Wno-ignored-qualifiers",  # due to use of breakpad headers
131     ]
133 with Files("**"):
134     BUG_COMPONENT = ("Core", "Gecko Profiler")