[sysprof] build: fix header installation paths



commit 00b6892a72b3c7fbfbd6e50d083ccb0ffa7618d3
Author: Christian Hergert <chergert redhat com>
Date:   Thu Sep 28 17:44:02 2017 -0700

    build: fix header installation paths

 lib/callgraph/meson.build   |   36 ++++++++++++++++++++++++++----------
 lib/capture/meson.build     |   14 ++++++++++----
 lib/meson.build             |   19 +++++++++----------
 lib/profiler/meson.build    |   14 ++++++++++----
 lib/sources/meson.build     |   14 ++++++++++----
 lib/symbols/meson.build     |   14 ++++++++++----
 lib/util/meson.build        |   33 +++++++++++++++++++++++++--------
 lib/visualizers/meson.build |   18 ++++++++++++++----
 lib/widgets/meson.build     |   18 ++++++++++++++----
 9 files changed, 128 insertions(+), 52 deletions(-)
---
diff --git a/lib/callgraph/meson.build b/lib/callgraph/meson.build
index 0302327..c8cf05f 100644
--- a/lib/callgraph/meson.build
+++ b/lib/callgraph/meson.build
@@ -1,17 +1,33 @@
-libsysprof_headers += files([
+callgraph_headers = [
   'sp-callgraph-profile.h',
-])
+]
 
-libsysprof_sources += files([
+callgraph_sources = [
   'sp-callgraph-profile-private.h',
   'sp-callgraph-profile.c',
-])
+]
 
+libsysprof_headers += files(callgraph_headers)
+libsysprof_sources += files(callgraph_sources)
 
-libsysprof_ui_headers += files([
-    'sp-callgraph-view.h',
-])
+install_headers(callgraph_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'callgraph'))
 
-libsysprof_ui_sources += files([
-    'sp-callgraph-view.c',
-])
+
+if get_option('enable_gtk')
+
+callgraph_ui_headers = [
+  'sp-callgraph-view.h',
+]
+
+callgraph_ui_sources = [
+  'sp-callgraph-view.c',
+]
+
+libsysprof_ui_headers += files(callgraph_ui_headers)
+libsysprof_ui_sources += files(callgraph_ui_sources)
+
+install_headers(callgraph_ui_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'callgraph'))
+
+endif
diff --git a/lib/capture/meson.build b/lib/capture/meson.build
index e23e492..fa75fed 100644
--- a/lib/capture/meson.build
+++ b/lib/capture/meson.build
@@ -1,14 +1,20 @@
-libsysprof_headers += files([
+capture_headers = [
   'sp-capture-condition.h',
   'sp-capture-cursor.h',
   'sp-capture-reader.h',
   'sp-capture-types.h',
   'sp-capture-writer.h',
-])
+]
 
-libsysprof_sources += files([
+capture_sources = [
   'sp-capture-condition.c',
   'sp-capture-cursor.c',
   'sp-capture-reader.c',
   'sp-capture-writer.c',
-])
+]
+
+libsysprof_headers += files(capture_headers)
+libsysprof_sources += files(capture_sources)
+
+install_headers(capture_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'capture'))
diff --git a/lib/meson.build b/lib/meson.build
index 5e33b12..2cff01b 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -5,6 +5,7 @@
 # components (for IDE integration).
 
 libsysprof_api_version = '2'
+libsysprof_header_subdir = 'sysprof-' + libsysprof_api_version
 
 libsysprof_version_conf = configuration_data()
 libsysprof_version = meson.project_version().split('.')
@@ -21,20 +22,22 @@ configure_file(
     install_dir: join_paths(get_option('includedir'), 'sysprof-' + libsysprof_api_version)
 )
 
-libsysprof_headers = [
+libsysprof_base_headers = [
   'sysprof.h',
   'sp-address.h',
   'sp-clock.h',
   'sp-error.h',
 ]
 
+libsysprof_headers = libsysprof_base_headers
 libsysprof_sources = [
   'sp-address.c',
   'sp-clock.c',
   'sp-error.c',
 ]
 
-libsysprof_ui_headers = ['sysprof-ui.h']
+libsysprof_ui_base_headers = ['sysprof-ui.h']
+libsysprof_ui_headers = libsysprof_ui_base_headers
 libsysprof_ui_sources = []
 
 subdir('callgraph')
@@ -70,16 +73,14 @@ libsysprof = shared_library('sysprof-' + libsysprof_api_version,
        install: true,
 )
 
-install_headers(libsysprof_headers,
-  subdir: 'sysprof-' + libsysprof_api_version,
-)
-
 libsysprof_dep = declare_dependency(
   include_directories: include_directories('.'),
      link_with: libsysprof,
   dependencies: libsysprof_deps,
 )
 
+install_headers(libsysprof_base_headers, subdir: libsysprof_header_subdir)
+
 if get_option('enable_gtk')
   # This is our GTK library containing the widgets suitable for viewing
   # and manipulating the various profiler API in libsysprof.  This is
@@ -104,14 +105,12 @@ if get_option('enable_gtk')
          install: true,
   )
 
-  install_headers(libsysprof_ui_headers,
-    subdir: 'sysprof-' + libsysprof_api_version,
-  )
-
   libsysprof_ui_dep = declare_dependency(
            dependencies: libsysprof_ui_deps,
               link_with: libsysprof_ui,
     include_directories: include_directories('.'),
   )
 
+  install_headers(libsysprof_ui_base_headers, subdir: libsysprof_header_subdir)
+
 endif
diff --git a/lib/profiler/meson.build b/lib/profiler/meson.build
index b9384a1..43b2f34 100644
--- a/lib/profiler/meson.build
+++ b/lib/profiler/meson.build
@@ -1,11 +1,17 @@
-libsysprof_headers += files([
+profiler_headers = [
   'sp-local-profiler.h',
   'sp-profile.h',
   'sp-profiler.h',
-])
+]
 
-libsysprof_sources += files([
+profiler_sources = [
   'sp-local-profiler.c',
   'sp-profile.c',
   'sp-profiler.c',
-])
+]
+
+libsysprof_headers += files(profiler_headers)
+libsysprof_sources += files(profiler_sources)
+
+install_headers(profiler_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'profiler'))
diff --git a/lib/sources/meson.build b/lib/sources/meson.build
index f9df088..a5dd0fa 100644
--- a/lib/sources/meson.build
+++ b/lib/sources/meson.build
@@ -1,12 +1,12 @@
-libsysprof_headers += files([
+sources_headers = [
   'sp-gjs-source.h',
   'sp-hostinfo-source.h',
   'sp-perf-source.h',
   'sp-proc-source.h',
   'sp-source.h',
-])
+]
 
-libsysprof_sources += files([
+sources_sources = [
   'sp-gjs-source.c',
   'sp-hostinfo-source.c',
   'sp-perf-counter.c',
@@ -14,4 +14,10 @@ libsysprof_sources += files([
   'sp-perf-source.c',
   'sp-proc-source.c',
   'sp-source.c',
-])
+]
+
+libsysprof_headers += files(sources_headers)
+libsysprof_sources += files(sources_sources)
+
+install_headers(sources_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'sources'))
diff --git a/lib/symbols/meson.build b/lib/symbols/meson.build
index 35c7486..78baac2 100644
--- a/lib/symbols/meson.build
+++ b/lib/symbols/meson.build
@@ -1,17 +1,23 @@
-libsysprof_headers += files([
+symbols_headers = [
   'sp-elf-symbol-resolver.h',
   'sp-jitmap-symbol-resolver.h',
   'sp-kernel-symbol-resolver.h',
   'sp-kernel-symbol.h',
   'sp-symbol-dirs.h',
   'sp-symbol-resolver.h',
-])
+]
 
-libsysprof_sources += files([
+symbols_sources = [
   'sp-elf-symbol-resolver.c',
   'sp-jitmap-symbol-resolver.c',
   'sp-kernel-symbol-resolver.c',
   'sp-kernel-symbol.c',
   'sp-symbol-dirs.c',
   'sp-symbol-resolver.c',
-])
+]
+
+libsysprof_headers += files(symbols_headers)
+libsysprof_sources += files(symbols_sources)
+
+install_headers(symbols_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'symbols'))
diff --git a/lib/util/meson.build b/lib/util/meson.build
index 350e619..4b3f18b 100644
--- a/lib/util/meson.build
+++ b/lib/util/meson.build
@@ -1,9 +1,9 @@
-libsysprof_headers += files([
+util_headers = [
   'sp-map-lookaside.h',
   'sp-selection.h',
-])
+]
 
-libsysprof_sources += files([
+util_sources = [
   'binfile.c',
   'binfile.h',
   'demangle.cpp',
@@ -18,16 +18,25 @@ libsysprof_sources += files([
   'sp-selection.c',
   'stackstash.c',
   'stackstash.h',
-])
+]
 
-libsysprof_ui_headers += files([
+libsysprof_headers += files(util_headers)
+libsysprof_sources += files(util_sources)
+
+install_headers(util_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'util'))
+
+
+if get_option('enable_gtk')
+
+util_ui_headers = [
   'sp-model-filter.h',
   'sp-process-model-item.h',
   'sp-process-model.h',
   'sp-zoom-manager.h',
-])
+]
 
-libsysprof_ui_sources += files([
+util_ui_sources = [
   'pointcache.c',
   'pointcache.h',
   'sp-color-cycle.c',
@@ -40,4 +49,12 @@ libsysprof_ui_sources += files([
   'sp-zoom-manager.c',
   'stackstash.c',
   'stackstash.h',
-])
+]
+
+libsysprof_ui_headers += files(util_ui_headers)
+libsysprof_ui_sources += files(util_ui_sources)
+
+install_headers(util_ui_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'util'))
+
+endif
diff --git a/lib/visualizers/meson.build b/lib/visualizers/meson.build
index 3ff02f5..11bacfd 100644
--- a/lib/visualizers/meson.build
+++ b/lib/visualizers/meson.build
@@ -1,11 +1,13 @@
-libsysprof_ui_headers += files([
+if get_option('enable_gtk')
+
+visualizer_ui_headers = [
   'sp-cpu-visualizer-row.h',
   'sp-line-visualizer-row.h',
   'sp-visualizer-row.h',
   'sp-visualizer-view.h',
-])
+]
 
-libsysprof_ui_sources += files([
+visualizer_ui_sources = [
   'sp-cpu-visualizer-row.c',
   'sp-line-visualizer-row.c',
   'sp-visualizer-list.c',
@@ -15,4 +17,12 @@ libsysprof_ui_sources += files([
   'sp-visualizer-ticks.c',
   'sp-visualizer-ticks.h',
   'sp-visualizer-view.c',
-])
+]
+
+libsysprof_ui_headers += files(visualizer_ui_headers)
+libsysprof_ui_sources += files(visualizer_ui_sources)
+
+install_headers(visualizer_ui_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'visualizers'))
+
+endif
diff --git a/lib/widgets/meson.build b/lib/widgets/meson.build
index decb67e..c24ff50 100644
--- a/lib/widgets/meson.build
+++ b/lib/widgets/meson.build
@@ -1,4 +1,6 @@
-libsysprof_ui_headers += files([
+if get_option('enable_gtk')
+
+widgets_ui_headers = [
   'sp-cell-renderer-percent.h',
   'sp-empty-state-view.h',
   'sp-failed-state-view.h',
@@ -6,9 +8,9 @@ libsysprof_ui_headers += files([
   'sp-process-model-row.h',
   'sp-profiler-menu-button.h',
   'sp-recording-state-view.h',
-])
+]
 
-libsysprof_ui_sources += files([
+widgets_ui_sources = [
   'sp-cell-renderer-percent.c',
   'sp-empty-state-view.c',
   'sp-failed-state-view.c',
@@ -16,4 +18,12 @@ libsysprof_ui_sources += files([
   'sp-process-model-row.c',
   'sp-profiler-menu-button.c',
   'sp-recording-state-view.c',
-])
+]
+
+libsysprof_ui_headers += files(widgets_ui_headers)
+libsysprof_ui_sources += files(widgets_ui_sources)
+
+install_headers(widgets_ui_headers,
+  subdir: join_paths(libsysprof_header_subdir, 'widgets'))
+
+endif


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