Skip to content

Don't install anything when building as subproject #662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions extras/fixture/src/meson.build
Original file line number Diff line number Diff line change
@@ -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
10 changes: 6 additions & 4 deletions extras/memory/src/meson.build
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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.
Expand Down
12 changes: 7 additions & 5 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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