mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-05-18 16:06:03 +08:00
Don't install anything when building as subproject
When a project is consuming unity as as subproject, unity headers, static library and pkg config files are installed by `meson install`. This can be fixed by using `meson install --skip-subprojects`, but this must be repeated in all the distros packaging a project. Fixed by disabling install when building as a subproject. Fixes: #661
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
unity_inc += include_directories('.')
|
||||
unity_src += files('unity_fixture.c')
|
||||
|
||||
install_headers(
|
||||
'unity_fixture.h',
|
||||
'unity_fixture_internals.h',
|
||||
subdir: meson.project_name()
|
||||
)
|
||||
if not meson.is_subproject()
|
||||
install_headers(
|
||||
'unity_fixture.h',
|
||||
'unity_fixture_internals.h',
|
||||
subdir: meson.project_name()
|
||||
)
|
||||
endif
|
||||
|
@ -1,7 +1,9 @@
|
||||
unity_inc += include_directories('.')
|
||||
unity_src += files('unity_memory.c')
|
||||
|
||||
install_headers(
|
||||
'unity_memory.h',
|
||||
subdir: meson.project_name()
|
||||
)
|
||||
if not meson.is_subproject()
|
||||
install_headers(
|
||||
'unity_memory.h',
|
||||
subdir: meson.project_name()
|
||||
)
|
||||
endif
|
||||
|
18
meson.build
18
meson.build
@ -45,7 +45,7 @@ endif
|
||||
unity_lib = static_library(meson.project_name(),
|
||||
sources: unity_src,
|
||||
include_directories: unity_inc,
|
||||
install: true
|
||||
install: not meson.is_subproject(),
|
||||
)
|
||||
|
||||
unity_dep = declare_dependency(
|
||||
@ -54,13 +54,15 @@ unity_dep = declare_dependency(
|
||||
)
|
||||
|
||||
# Generate pkg-config file.
|
||||
pkg = import('pkgconfig')
|
||||
pkg.generate(
|
||||
name: meson.project_name(),
|
||||
version: meson.project_version(),
|
||||
libraries: [ unity_lib ],
|
||||
description: 'C Unit testing framework.'
|
||||
)
|
||||
if not meson.is_subproject()
|
||||
pkg = import('pkgconfig')
|
||||
pkg.generate(
|
||||
name: meson.project_name(),
|
||||
version: meson.project_version(),
|
||||
libraries: [ unity_lib ],
|
||||
description: 'C Unit testing framework.'
|
||||
)
|
||||
endif
|
||||
|
||||
# Create a generator that can be used by consumers of our build system to generate
|
||||
# test runners.
|
||||
|
@ -8,8 +8,10 @@
|
||||
unity_inc += include_directories('.')
|
||||
unity_src += files('unity.c')
|
||||
|
||||
install_headers(
|
||||
'unity.h',
|
||||
'unity_internals.h',
|
||||
subdir: meson.project_name()
|
||||
)
|
||||
if not meson.is_subproject()
|
||||
install_headers(
|
||||
'unity.h',
|
||||
'unity_internals.h',
|
||||
subdir: meson.project_name()
|
||||
)
|
||||
endif
|
||||
|
Reference in New Issue
Block a user