From 027f90dc9386ec08f2a5107025683e5fed6f3444 Mon Sep 17 00:00:00 2001
From: Markus Volk <f_l_k@t-online.de>
Date: Mon, 17 Oct 2022 19:20:53 +0200
Subject: [PATCH] meson: add PC file for lib_perfetto

---
 meson.build | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- a/meson.build
+++ b/meson.build
@@ -19,9 +19,12 @@
 project(
     'perfetto',
     ['cpp'],
-    default_options: ['cpp_std=c++17']
+    default_options: ['cpp_std=c++17'],
+    version: '31.0'
 )
 
+soversion = meson.project_version()
+
 fs = import('fs')
 
 if not fs.is_dir('sdk')
@@ -36,8 +39,9 @@ if host_machine.system() == 'android'
   deps_perfetto += cpp.find_library('log')
 endif
 
-lib_perfetto = static_library(
+lib_perfetto = shared_library(
     'perfetto',
+    version: soversion,
     sources: 'sdk/perfetto.cc',
     dependencies: deps_perfetto,
     install: true,
@@ -50,6 +54,10 @@ dir_perfetto_trace = join_paths(meson.cu
 
 install_data(dir_perfetto_trace / 'perfetto_trace.proto')
 
+install_headers('sdk/perfetto.h')
+pkg = import('pkgconfig')
+pkg.generate(lib_perfetto)
+
 dep_perfetto = declare_dependency(
     link_with: lib_perfetto,
     include_directories: inc_perfetto,
