[gst-debugger] protobuf requires exactly the same version of library as a compiler used for generating files



commit 608c1b29e00e1c90006eaf65215e8772db10612f
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Fri Oct 20 12:42:10 2017 +0100

    protobuf requires exactly the same version of library as a compiler used for generating files
    
    Revert "Add generated files to repository"
    
    This reverts commit 365d4853c2e58c1e18ab7a4f2b169f93fecc4126.

 .gitignore                         |    4 +
 meson.build                        |    6 +-
 src/common/gstdebugger.pb-c.c      | 3792 -------
 src/common/gstdebugger.pb-c.h      | 1302 ---
 src/common/meson.build             |   20 +-
 src/gst-debugger/gstdebugger.pb.cc |18994 ------------------------------------
 src/gst-debugger/gstdebugger.pb.h  |10387 --------------------
 src/gst-debugger/meson.build       |   10 +-
 src/meson.build                    |    8 -
 tools/generate-proto.py            |   18 -
 10 files changed, 35 insertions(+), 34506 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b97a9db..fd8c8f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,6 +49,10 @@ Makefile
 /src/gst-debugger/gst-debugger-resources.h
 
 # /src/common
+/src/common/gstdebugger.pb-c.c
+/src/common/gstdebugger.pb-c.h
+/src/common/gstdebugger.pb.cc
+/src/common/gstdebugger.pb.h
 /src/common/libgst-debugger-common-0.1.pc
 
 # intltool/gettext
diff --git a/meson.build b/meson.build
index c93b0b9..8a733f7 100644
--- a/meson.build
+++ b/meson.build
@@ -13,7 +13,6 @@ gst_apiversion = '1.0'
 
 # Modules
 gnome = import('gnome')
-python = import('python3')
 
 # Dependencies
 glib_version = '2.41.1'
@@ -32,9 +31,12 @@ protobuf_dep = dependency('protobuf', version : '>=2.6.1')
 boost_dep = dependency('boost', modules : ['filesystem', 'system'], version : '>=1.55')
 thread_dep = dependency('threads')
 
+# Dependency apps
+protoc_c = find_program('protoc-c')
+
 # Configuration file
 conf = configuration_data()
-conf.set_quoted('PACKAGE_NAME', 'gst-debugger')
+conf.set_quoted('PACKAGE_NAME', 'gnome-paint')
 conf.set_quoted('VERSION', meson.project_version())
 conf.set_quoted('GST_DEBUGGER_LOCALEDIR', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
 conf.set('GETTEXT_PACKAGE', 'PACKAGE_NAME')
diff --git a/src/common/meson.build b/src/common/meson.build
index 9b066ab..bedb8b2 100644
--- a/src/common/meson.build
+++ b/src/common/meson.build
@@ -1,9 +1,25 @@
 install_headers_dir = join_paths('gstdebugger-@0@'.format(apiversion), 'gst', 'debugger')
 
+protoc_c_gen = generator(protoc_c,
+    output    : ['@BASENAME@.pb-c.c', '@BASENAME@.pb-c.h'],
+    arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--c_out=@BUILD_DIR@', '@INPUT@'])
+protoc_c_gen_src = protoc_c_gen.process('gstdebugger.proto')
+
+generate_c_proto = custom_target('generate_proto',
+   output : ['gstdebugger.pb-c.h'],
+    input : 'gstdebugger.proto',
+    command : [
+        protoc_c,
+        '--proto_path=' + meson.current_source_dir(),
+        '--c_out=' + meson.current_build_dir(),
+        '--c_out=' + meson.current_source_dir(),
+        join_paths(meson.current_source_dir(), 'gstdebugger.proto')],
+    install : true,
+    install_dir : [join_paths(get_option('prefix'), get_option('includedir'), install_headers_dir)])
+
 gstdebugger_common_sources = [
     'gst-utils.c',
     'protocol-utils.c',
-    'gstdebugger.pb-c.c',
     'serializer.c']
 
 gstdebugger_common_headers = [
@@ -20,6 +36,8 @@ gstdebugger_common_deps = [
 gstdebugger_common_lib = shared_library(
     'gstdebugger-common-@0@'.format(apiversion),
     gstdebugger_common_sources,
+    generate_c_proto,
+    protoc_c_gen_src,
     dependencies : gstdebugger_common_deps,
     install : true)
 
diff --git a/src/gst-debugger/meson.build b/src/gst-debugger/meson.build
index a109f45..546c20e 100644
--- a/src/gst-debugger/meson.build
+++ b/src/gst-debugger/meson.build
@@ -1,3 +1,10 @@
+proto_src_path = join_paths(meson.current_source_dir(), '..', 'common')
+protoc_gen = generator(find_program('protoc'),
+    output    : ['@BASENAME  pb cc', '@BASENAME@.pb.h'],
+    arguments : ['--proto_path=' + proto_src_path, '--cpp_out=@BUILD_DIR@', join_paths(proto_src_path, 
'gstdebugger.proto')])
+
+protoc_gen_src = protoc_gen.process(join_paths(proto_src_path, 'gstdebugger.proto'))
+
 gstd_resources = gnome.compile_resources(
     'gst-debugger-resources', 'gst-debugger-resources.xml',
     source_dir : '.',
@@ -7,8 +14,6 @@ gst_debugger_sources = [
     'main.cpp',
     'main_window.cpp',
     'main_window.h',
-    'gstdebugger.pb.cc',
-    'gstdebugger.pb.h',
     'controller/controller.cpp',
     'controller/controller.h',
     'controller/command_factory.cpp',
@@ -92,6 +97,7 @@ exe_name = '@0@-@1@'.format('gst-debugger', gst_apiversion)
 executable(
     exe_name,
     gst_debugger_sources,
+    protoc_gen_src,
     include_directories : config_inc_dir,
     install : true,
     dependencies : [
diff --git a/src/meson.build b/src/meson.build
index a7fbb2c..250c20b 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,11 +1,3 @@
-# Generate proto source files
-run_target('generateproto',
-    command : [
-        python.find_python(),
-        join_paths(meson.source_root(), 'tools/generate-proto.py'),
-        join_paths(meson.current_source_dir(), 'common'),
-        join_paths(meson.current_source_dir(), 'gst-debugger')])
-
 subdir('common')
 subdir('debugserver')
 subdir('gst-debugger')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]