| 1 |
project('sub2', 'c', 'cpp', |
| 2 |
default_options : ['default_library=shared', |
| 3 |
'werror=false', |
| 4 |
'cpp_std=c++14']) |
| 5 |
|
| 6 |
assert(get_option('default_library') == 'static', 'Parent should override default_library') |
| 7 |
assert(not get_option('werror')) |
| 8 |
assert(get_option('cpp_std') == 'c++14') |
| 9 |
|
| 10 |
# If it doesn't build only a static library, it would make target name clash. |
| 11 |
library('lib1', 'foo.c') |
| 12 |
shared_library('lib1', 'foo.c') |
| 13 |
|
| 14 |
# Parent project is c++11 but this one uses c++14 to build. |
| 15 |
libcpp14 = library('lib2', 'foo.cpp') |
| 16 |
meson.override_dependency('libcpp14', declare_dependency(link_with: libcpp14)) |
| 17 |
|
| 18 |
# Compiler checks should be using c++14 as well |
| 19 |
cxx = meson.get_compiler('cpp') |
| 20 |
assert(cxx.compiles(files('foo.cpp'))) |