Commit d0f0de20 authored by Philip Withnall's avatar Philip Withnall

build: Don’t install things if used as a subproject

When used as a subproject, we expect to be built as a static library,
and not distributed in any recognisable form as libglib-testing. So
don’t install libglib-testing things when `ninja install` is run for the
module which includes libglib-testing as a subproject.
Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
parent d8c80175
Pipeline #45175 failed with stages
in 61 minutes and 39 seconds
......@@ -20,5 +20,5 @@ gnome.gtkdoc('libglib-testing',
'--ignore-decorators=G_GNUC_WARN_UNUSED_RESULT',
'--ignore-headers=' + ' '.join(['tests']),
],
install: true,
install: not meson.is_subproject(),
)
\ No newline at end of file
......@@ -19,7 +19,7 @@ libglib_testing = library(libglib_testing_api_name,
libglib_testing_sources + libglib_testing_headers,
dependencies: libglib_testing_public_deps,
include_directories: root_inc,
install: true,
install: not meson.is_subproject(),
version: meson.project_version(),
soversion: libglib_testing_api_version,
)
......@@ -29,19 +29,21 @@ libglib_testing_dep = declare_dependency(
)
# Public library bits.
install_headers(libglib_testing_headers,
subdir: libglib_testing_include_subdir,
)
if not meson.is_subproject()
install_headers(libglib_testing_headers,
subdir: libglib_testing_include_subdir,
)
pkgconfig.generate(
libraries: [ libglib_testing ],
subdirs: libglib_testing_api_name,
version: meson.project_version(),
name: 'libglib-testing',
filebase: libglib_testing_api_name,
description: 'libglib-testing provides test harnesses and mock classes.',
requires: libglib_testing_public_deps,
)
pkgconfig.generate(
libraries: [ libglib_testing ],
subdirs: libglib_testing_api_name,
version: meson.project_version(),
name: 'libglib-testing',
filebase: libglib_testing_api_name,
description: 'libglib-testing provides test harnesses and mock classes.',
requires: libglib_testing_public_deps,
)
endif
subdir('docs')
subdir('tests')
\ No newline at end of file
......@@ -90,7 +90,7 @@ test_c_args = [
cc = meson.get_compiler('c')
add_project_arguments(cc.get_supported_arguments(test_c_args), language: 'c')
enable_installed_tests = get_option('installed_tests')
enable_installed_tests = get_option('installed_tests') and not meson.is_subproject()
test_template = files('template.test.in')
test_env = [
'G_DEBUG=gc-friendly,fatal-warnings',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment