Define tomlplusplus_dep for when included in subproject. Added option BUILD_TESTS, default false.

This commit is contained in:
Gábor Kozár 2020-03-04 12:01:46 +01:00
parent 74e7209cca
commit 865561b46c
2 changed files with 12 additions and 3 deletions

View File

@ -11,7 +11,6 @@ project(
] ]
) )
compiler = meson.get_compiler('cpp') compiler = meson.get_compiler('cpp')
message(['compiler ID: ', compiler.get_id()]) message(['compiler ID: ', compiler.get_id()])
@ -73,7 +72,16 @@ compiler_supports_char8_strings = compiler.compiles('''
args : [ '-std=c++2a' ] args : [ '-std=c++2a' ]
) )
inc = include_directories(['include', 'extern']) tomlplusplus_dep = declare_dependency(
include_directories : include_directories('include'),
version : meson.project_version(),
)
if get_option('BUILD_TESTS')
inc = include_directories('include', 'extern')
subdir('tests')
else
message('Not building tests')
endif
subdir('tests')
# subdir('examples') # subdir('examples')

1
meson_options.txt Normal file
View File

@ -0,0 +1 @@
option('BUILD_TESTS', type : 'boolean', value : false, description : 'Whether to build tests')