diff --git a/.gitlab-ci/meson/build.sh b/.gitlab-ci/meson/build.sh index 99d409c4933..c404c0a5652 100755 --- a/.gitlab-ci/meson/build.sh +++ b/.gitlab-ci/meson/build.sh @@ -148,7 +148,7 @@ fi # these projects and making them warning-free is not our goal. # shellcheck disable=2206 meson_subprojects=( - perfetto + perfetto-sdk syn-2-rs paste-1-rs pest-2-rs diff --git a/docs/perfetto.rst b/docs/perfetto.rst index b65ffb99951..64715a03247 100644 --- a/docs/perfetto.rst +++ b/docs/perfetto.rst @@ -67,12 +67,12 @@ To capture a trace with Perfetto you need to take the following steps: # Build mesa mesa $ meson compile -C build -2. Build Perfetto from sources available at ``subprojects/perfetto``. +2. Clone and build Perfetto toolkit (``v56.1``). .. code-block:: sh - # Within the Mesa repo, build perfetto - mesa $ cd subprojects/perfetto + src $ git clone --branch v56.1 --depth 1 https://github.com/google/perfetto.git + src $ cd perfetto perfetto $ ./tools/install-build-deps perfetto $ ./tools/gn gen --args='is_debug=false' out/linux perfetto $ ./tools/ninja -C out/linux @@ -87,7 +87,7 @@ More build options can be found in `this guide `__ and upload ``vkcube.trace`` by clicking on **Open trace file**. diff --git a/meson.build b/meson.build index e82403014e6..4ac2cec7977 100644 --- a/meson.build +++ b/meson.build @@ -2367,10 +2367,11 @@ with_perfetto = get_option('perfetto') with_datasources = get_option('datasources') with_any_datasource = with_datasources.length() != 0 if with_perfetto - dep_perfetto = dependency( + dep_perfetto_sdk = dependency( 'perfetto', - fallback: allow_fallback_for_perfetto ? ['perfetto', 'dep_perfetto'] : [], + fallback: allow_fallback_for_perfetto ? ['perfetto-sdk', 'dep_perfetto_sdk'] : [], ) + dep_perfetto = dep_perfetto_sdk pre_args += '-DHAVE_PERFETTO' endif diff --git a/subprojects/packagefiles/perfetto-sdk/meson.build b/subprojects/packagefiles/perfetto-sdk/meson.build new file mode 100644 index 00000000000..b4652408f14 --- /dev/null +++ b/subprojects/packagefiles/perfetto-sdk/meson.build @@ -0,0 +1,28 @@ +project( + 'perfetto-sdk', + ['cpp'], +) + +cpp = meson.get_compiler('cpp') + +deps_perfetto = [dependency('threads')] + +if host_machine.system() == 'android' + deps_perfetto += cpp.find_library('log') +endif + +lib_perfetto = static_library( + 'perfetto', + sources: 'perfetto.cc', + dependencies: deps_perfetto, + install: false, + override_options : ['cpp_std=c++17'] +) + +inc_perfetto = include_directories('.') + +dep_perfetto_sdk = declare_dependency( + link_with: lib_perfetto, + include_directories: inc_perfetto, + dependencies: deps_perfetto, +) diff --git a/subprojects/perfetto-sdk.wrap b/subprojects/perfetto-sdk.wrap new file mode 100644 index 00000000000..fb4cf18c0b1 --- /dev/null +++ b/subprojects/perfetto-sdk.wrap @@ -0,0 +1,8 @@ +[wrap-file] +directory = perfetto-sdk +lead_directory_missing = true + +source_url = https://github.com/google/perfetto/releases/download/v56.1/perfetto-cpp-sdk-src.zip +source_filename = perfetto-cpp-sdk-src-v56.1.zip +source_hash = 9138dad1ab39048a61d3333e0c2ebf32a7497ed45e3b7daa5f3a02c14748af38 +patch_directory = perfetto-sdk diff --git a/subprojects/perfetto.wrap b/subprojects/perfetto.wrap deleted file mode 100644 index 5e32319a35b..00000000000 --- a/subprojects/perfetto.wrap +++ /dev/null @@ -1,6 +0,0 @@ -[wrap-git] -directory = perfetto - -url = https://github.com/google/perfetto -revision = v47.0 -depth = 1