mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-03-22 05:01:27 +00:00
build: Add subproject support for libsysprof-capture
This will be used to build libsysprof-capture as a subproject within libglib, with the symbols from libglib being left unresolved until the static libsysprof-capture is linked into libglib. When built as a subproject, libsysprof-capture won’t install anything. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@ -13,7 +13,9 @@ libsysprof_capture_headers = files([
|
|||||||
'sysprof-version-macros.h',
|
'sysprof-version-macros.h',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if not meson.is_subproject()
|
||||||
install_headers(libsysprof_capture_headers, subdir: sysprof_header_subdir)
|
install_headers(libsysprof_capture_headers, subdir: sysprof_header_subdir)
|
||||||
|
endif
|
||||||
|
|
||||||
libsysprof_capture_sources = files([
|
libsysprof_capture_sources = files([
|
||||||
'mapped-ring-buffer.c',
|
'mapped-ring-buffer.c',
|
||||||
@ -34,6 +36,7 @@ configure_file(
|
|||||||
output: 'sysprof-version.h',
|
output: 'sysprof-version.h',
|
||||||
configuration: sysprof_version_conf,
|
configuration: sysprof_version_conf,
|
||||||
install_dir: join_paths(get_option('includedir'), sysprof_header_subdir),
|
install_dir: join_paths(get_option('includedir'), sysprof_header_subdir),
|
||||||
|
install: not meson.is_subproject(),
|
||||||
)
|
)
|
||||||
|
|
||||||
libsysprof_capture_deps = [
|
libsysprof_capture_deps = [
|
||||||
@ -47,7 +50,7 @@ libsysprof_capture = static_library(
|
|||||||
dependencies: libsysprof_capture_deps,
|
dependencies: libsysprof_capture_deps,
|
||||||
c_args: [ '-DSYSPROF_CAPTURE_COMPILATION' ],
|
c_args: [ '-DSYSPROF_CAPTURE_COMPILATION' ],
|
||||||
install_dir: get_option('libdir'),
|
install_dir: get_option('libdir'),
|
||||||
install: true,
|
install: not meson.is_subproject(),
|
||||||
gnu_symbol_visibility: 'hidden',
|
gnu_symbol_visibility: 'hidden',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -59,6 +62,7 @@ libsysprof_capture_dep = declare_dependency(
|
|||||||
include_directories: libsysprof_capture_include_dirs,
|
include_directories: libsysprof_capture_include_dirs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not meson.is_subproject()
|
||||||
pkgconfig.generate(
|
pkgconfig.generate(
|
||||||
libraries: [libsysprof_capture],
|
libraries: [libsysprof_capture],
|
||||||
subdirs: [ sysprof_header_subdir ],
|
subdirs: [ sysprof_header_subdir ],
|
||||||
@ -71,3 +75,4 @@ pkgconfig.generate(
|
|||||||
'datadir=' + datadir_for_pc_file,
|
'datadir=' + datadir_for_pc_file,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user