Skip to content

Commit f9879bf

Browse files
authored
Merge pull request #662 from nirs/skip-subproject-install
Don't install anything when building as subproject
2 parents 0854f3d + 18482ab commit f9879bf

File tree

4 files changed

+30
-22
lines changed

4 files changed

+30
-22
lines changed

extras/fixture/src/meson.build

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
unity_inc += include_directories('.')
22
unity_src += files('unity_fixture.c')
33

4-
install_headers(
5-
'unity_fixture.h',
6-
'unity_fixture_internals.h',
7-
subdir: meson.project_name()
8-
)
4+
if not meson.is_subproject()
5+
install_headers(
6+
'unity_fixture.h',
7+
'unity_fixture_internals.h',
8+
subdir: meson.project_name()
9+
)
10+
endif

extras/memory/src/meson.build

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
unity_inc += include_directories('.')
22
unity_src += files('unity_memory.c')
33

4-
install_headers(
5-
'unity_memory.h',
6-
subdir: meson.project_name()
7-
)
4+
if not meson.is_subproject()
5+
install_headers(
6+
'unity_memory.h',
7+
subdir: meson.project_name()
8+
)
9+
endif

meson.build

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ endif
4545
unity_lib = static_library(meson.project_name(),
4646
sources: unity_src,
4747
include_directories: unity_inc,
48-
install: true
48+
install: not meson.is_subproject(),
4949
)
5050

5151
unity_dep = declare_dependency(
@@ -54,13 +54,15 @@ unity_dep = declare_dependency(
5454
)
5555

5656
# Generate pkg-config file.
57-
pkg = import('pkgconfig')
58-
pkg.generate(
59-
name: meson.project_name(),
60-
version: meson.project_version(),
61-
libraries: [ unity_lib ],
62-
description: 'C Unit testing framework.'
63-
)
57+
if not meson.is_subproject()
58+
pkg = import('pkgconfig')
59+
pkg.generate(
60+
name: meson.project_name(),
61+
version: meson.project_version(),
62+
libraries: [ unity_lib ],
63+
description: 'C Unit testing framework.'
64+
)
65+
endif
6466

6567
# Create a generator that can be used by consumers of our build system to generate
6668
# test runners.

src/meson.build

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
unity_inc += include_directories('.')
99
unity_src += files('unity.c')
1010

11-
install_headers(
12-
'unity.h',
13-
'unity_internals.h',
14-
subdir: meson.project_name()
15-
)
11+
if not meson.is_subproject()
12+
install_headers(
13+
'unity.h',
14+
'unity_internals.h',
15+
subdir: meson.project_name()
16+
)
17+
endif

0 commit comments

Comments
 (0)