Skip to content

Commit 17f757f

Browse files
committed
Small fixes to the meson logic
1 parent dae31be commit 17f757f

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

meson.build

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ configure_file(output : 'config.hpp',
2424
cfgfile = custom_target('make-config',
2525
input : join_paths(meson.current_build_dir(), 'config.hpp'),
2626
output : ['config.hpp.fake-meson'],
27-
command : ['sh', '-c', 'rm -f ../include/config.hpp && ln -s @INPUT0@ ../include/config.hpp'],
27+
command : ['sh', '-c', 'rm -f @CURRENT_SOURCE_DIR@/include/config.hpp && ln -s @INPUT0@ @CURRENT_SOURCE_DIR@/include/config.hpp'],
2828
capture : true,
2929
install : false,
3030
build_by_default: true
@@ -80,15 +80,20 @@ install_headers(
8080
subdir: 'vs-templ',
8181
)
8282

83-
if get_option('tests')
84-
subdir(['./test/'])
85-
endif
83+
# Ignore these targets if not the root project
84+
if meson.is_subproject() == false
8685

87-
if get_option('benchmarks')
88-
subdir(['./benchmark/'])
89-
endif
86+
if get_option('tests')
87+
subdir(['./test/'])
88+
endif
9089

91-
subdir(['./metadata/'])
90+
if get_option('benchmarks')
91+
subdir(['./benchmark/'])
92+
endif
93+
94+
subdir(['./metadata/'])
95+
96+
endif
9297

9398
pconf = import('pkgconfig')
9499
pconf.generate(

0 commit comments

Comments
 (0)