diff options
27 files changed, 66 insertions, 29 deletions
diff --git a/.github/workflows/os_comp.yml b/.github/workflows/os_comp.yml index 5b49142..34b113b 100644 --- a/.github/workflows/os_comp.yml +++ b/.github/workflows/os_comp.yml @@ -52,7 +52,11 @@ jobs: cfg: - CC: 'gcc' CXX: 'g++' - - MESON_ARGS: '--unity=on' + - MESON_ARGS: '--unity=on -Ddefault_library=static' + RUN_TESTS_ARGS: '--no-unittests' + CC: 'gcc' + CXX: 'g++' + - MESON_ARGS: '-Ddefault_library=both' RUN_TESTS_ARGS: '--no-unittests' CC: 'gcc' CXX: 'g++' diff --git a/test cases/common/102 extract same name/meson.build b/test cases/common/102 extract same name/meson.build index e15561d..08daa5b 100644 --- a/test cases/common/102 extract same name/meson.build +++ b/test cases/common/102 extract same name/meson.build @@ -12,7 +12,7 @@ if meson.backend() == 'xcode' error('MESON_SKIP_TEST, Xcode can not extract objs when they would have the same filename.') endif -lib = shared_library('somelib', ['lib.c', 'src/lib.c']) +lib = library('somelib', ['lib.c', 'src/lib.c']) # Also tests that the object list is flattened properly obj = lib.extract_objects(['lib.c', ['src/lib.c']]) exe = executable('main', 'main.c', objects: obj) diff --git a/test cases/common/126 generated llvm ir/meson.build b/test cases/common/126 generated llvm ir/meson.build index e5c68bc..f10754a 100644 --- a/test cases/common/126 generated llvm ir/meson.build +++ b/test cases/common/126 generated llvm ir/meson.build @@ -14,7 +14,7 @@ copygen = generator(copy, arguments : ['@INPUT@', '@OUTPUT@'], output : '@BASENAME@') -l = shared_library('square-gen', copygen.process('square.ll.in')) +l = library('square-gen', copygen.process('square.ll.in')) test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l)) @@ -23,6 +23,6 @@ copyct = custom_target('square', output : 'square.ll', command : [copy, '@INPUT@', '@OUTPUT@']) -l = shared_library('square-ct', copyct) +l = library('square-ct', copyct) test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l)) diff --git a/test cases/common/127 generated assembly/meson.build b/test cases/common/127 generated assembly/meson.build index 6d614a9..31a5f17 100644 --- a/test cases/common/127 generated assembly/meson.build +++ b/test cases/common/127 generated assembly/meson.build @@ -50,7 +50,7 @@ copygen = generator(copy, arguments : ['@INPUT@', '@OUTPUT@'], output : '@BASENAME@') -l = shared_library('square-gen', crt_workaround + [copygen.process(input)], +l = library('square-gen', crt_workaround + [copygen.process(input)], vs_module_defs: 'square.def') test('square-gen-test', executable('square-gen-test', 'main.c', link_with : l)) @@ -60,7 +60,7 @@ copyct = custom_target('square', output : output, command : [copy, '@INPUT@', '@OUTPUT@']) -l = shared_library('square-ct', crt_workaround + [copyct], +l = library('square-ct', crt_workaround + [copyct], vs_module_defs: 'square.def') test('square-ct-test', executable('square-ct-test', 'main.c', link_with : l)) diff --git a/test cases/common/146 library at root/meson.build b/test cases/common/146 library at root/meson.build index bfdd869..e652671 100644 --- a/test cases/common/146 library at root/meson.build +++ b/test cases/common/146 library at root/meson.build @@ -1,3 +1,3 @@ project('lib@root', 'c') -lib = shared_library('lib', 'lib.c') +lib = library('lib', 'lib.c') subdir('main') diff --git a/test cases/common/153 wrap file should not failed/subprojects/zlib-1.2.8/meson.build b/test cases/common/153 wrap file should not failed/subprojects/zlib-1.2.8/meson.build index 8d8008e..70d493f 100644 --- a/test cases/common/153 wrap file should not failed/subprojects/zlib-1.2.8/meson.build +++ b/test cases/common/153 wrap file should not failed/subprojects/zlib-1.2.8/meson.build @@ -1,2 +1,2 @@ project('shared lib', 'c') -shared_library('foo', 'foo.c') +library('foo', 'foo.c') diff --git a/test cases/common/155 subproject dir name collision/custom_subproject_dir/B/meson.build b/test cases/common/155 subproject dir name collision/custom_subproject_dir/B/meson.build index 280c60c..8f4cb02 100644 --- a/test cases/common/155 subproject dir name collision/custom_subproject_dir/B/meson.build +++ b/test cases/common/155 subproject dir name collision/custom_subproject_dir/B/meson.build @@ -1,4 +1,4 @@ project('B', 'c') C = subproject('C') c = C.get_variable('c') -b = shared_library('b', 'b.c', link_with : c) +b = library('b', 'b.c', link_with : c) diff --git a/test cases/common/155 subproject dir name collision/custom_subproject_dir/C/meson.build b/test cases/common/155 subproject dir name collision/custom_subproject_dir/C/meson.build index abf0b1e..5d89097 100644 --- a/test cases/common/155 subproject dir name collision/custom_subproject_dir/C/meson.build +++ b/test cases/common/155 subproject dir name collision/custom_subproject_dir/C/meson.build @@ -1,2 +1,2 @@ project('C', 'c') -c = shared_library('c', 'c.c') +c = library('c', 'c.c') diff --git a/test cases/common/155 subproject dir name collision/other_subdir/meson.build b/test cases/common/155 subproject dir name collision/other_subdir/meson.build index 90cb67a..37cb623 100644 --- a/test cases/common/155 subproject dir name collision/other_subdir/meson.build +++ b/test cases/common/155 subproject dir name collision/other_subdir/meson.build @@ -1 +1 @@ -other = shared_library('other', 'custom_subproject_dir/other.c') +other = library('other', 'custom_subproject_dir/other.c') diff --git a/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build index 12f6564..1014db1 100644 --- a/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build +++ b/test cases/common/167 subproject nested subproject dirs/contrib/subprojects/alpha/meson.build @@ -1,4 +1,4 @@ project('alpha project', 'c', subproject_dir: 'var/subprojects') b = subproject('beta') -l = shared_library('a', 'a.c', link_with : b.get_variable('lb')) +l = library('a', 'a.c', link_with : b.get_variable('lb')) diff --git a/test cases/common/178 bothlibraries/dummy.py b/test cases/common/178 bothlibraries/dummy.py new file mode 100644 index 0000000..9e838ba --- /dev/null +++ b/test cases/common/178 bothlibraries/dummy.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +from pathlib import Path +import sys + +if __name__ == '__main__': + Path(sys.argv[1]).write_text('Hello World\n') + raise SystemExit(0) diff --git a/test cases/common/178 bothlibraries/meson.build b/test cases/common/178 bothlibraries/meson.build index d52158d..9df4cd1 100644 --- a/test cases/common/178 bothlibraries/meson.build +++ b/test cases/common/178 bothlibraries/meson.build @@ -1,15 +1,29 @@ project('both libraries linking test', 'c') both_libs = both_libraries('mylib', 'libfile.c') +dep = declare_dependency(link_with: both_libs) exe_shared = executable('prog-shared', 'main.c', link_with : both_libs.get_shared_lib()) exe_static = executable('prog-static', 'main.c', c_args : ['-DSTATIC_COMPILATION'], link_with : both_libs.get_static_lib()) exe_both = executable('prog-both', 'main.c', link_with : both_libs) +exe_dep = executable('prog-dep', 'main.c', dependencies : [dep]) + +# Try using it in a custom_target +custom_target('tgt_a', + command: [ + find_program('./dummy.py'), + '@OUTPUT@', + both_libs, + ], + output: ['hello1.txt'], + input: [both_libs], +) test('runtest-shared', exe_shared) test('runtest-static', exe_static) test('runtest-both', exe_both) +test('runtest-dep', exe_dep) # Same as above, but using build_target() both_libs2 = build_target('mylib2', 'libfile.c', target_type: 'both_libraries') diff --git a/test cases/common/22 object extraction/meson.build b/test cases/common/22 object extraction/meson.build index fd4af8c..4847fa1 100644 --- a/test cases/common/22 object extraction/meson.build +++ b/test cases/common/22 object extraction/meson.build @@ -3,8 +3,8 @@ project('object extraction', 'c') if meson.is_unity() message('Skipping extraction test because this is a Unity build.') else - lib1 = shared_library('somelib', 'src/lib.c') - lib2 = shared_library('somelib2', 'lib.c', 'header.h', 'lib2.c') + lib1 = library('somelib', 'src/lib.c') + lib2 = library('somelib2', 'lib.c', 'header.h', 'lib2.c') obj1 = lib1.extract_objects('src/lib.c') obj2 = lib2.extract_objects(['lib.c']) diff --git a/test cases/common/223 persubproject options/meson.build b/test cases/common/223 persubproject options/meson.build index f76a70c..b9cbfe2 100644 --- a/test cases/common/223 persubproject options/meson.build +++ b/test cases/common/223 persubproject options/meson.build @@ -1,6 +1,5 @@ project('persubproject options', 'c', - default_options : ['default_library=both', - 'werror=true', + default_options : ['werror=true', 'warning_level=3']) assert(get_option('default_library') == 'both', 'Parent default_library should be "both"') diff --git a/test cases/common/223 persubproject options/test.json b/test cases/common/223 persubproject options/test.json new file mode 100644 index 0000000..ccfa9ff --- /dev/null +++ b/test cases/common/223 persubproject options/test.json @@ -0,0 +1,7 @@ +{ + "matrix": { + "options": { + "default_library": [ { "val": "both" } ] + } + } +} diff --git a/test cases/common/72 shared subproject/subprojects/B/meson.build b/test cases/common/72 shared subproject/subprojects/B/meson.build index 280c60c..8f4cb02 100644 --- a/test cases/common/72 shared subproject/subprojects/B/meson.build +++ b/test cases/common/72 shared subproject/subprojects/B/meson.build @@ -1,4 +1,4 @@ project('B', 'c') C = subproject('C') c = C.get_variable('c') -b = shared_library('b', 'b.c', link_with : c) +b = library('b', 'b.c', link_with : c) diff --git a/test cases/common/72 shared subproject/subprojects/C/meson.build b/test cases/common/72 shared subproject/subprojects/C/meson.build index abf0b1e..5d89097 100644 --- a/test cases/common/72 shared subproject/subprojects/C/meson.build +++ b/test cases/common/72 shared subproject/subprojects/C/meson.build @@ -1,2 +1,2 @@ project('C', 'c') -c = shared_library('c', 'c.c') +c = library('c', 'c.c') diff --git a/test cases/common/73 shared subproject 2/subprojects/B/meson.build b/test cases/common/73 shared subproject 2/subprojects/B/meson.build index 280c60c..8f4cb02 100644 --- a/test cases/common/73 shared subproject 2/subprojects/B/meson.build +++ b/test cases/common/73 shared subproject 2/subprojects/B/meson.build @@ -1,4 +1,4 @@ project('B', 'c') C = subproject('C') c = C.get_variable('c') -b = shared_library('b', 'b.c', link_with : c) +b = library('b', 'b.c', link_with : c) diff --git a/test cases/common/73 shared subproject 2/subprojects/C/meson.build b/test cases/common/73 shared subproject 2/subprojects/C/meson.build index abf0b1e..5d89097 100644 --- a/test cases/common/73 shared subproject 2/subprojects/C/meson.build +++ b/test cases/common/73 shared subproject 2/subprojects/C/meson.build @@ -1,2 +1,2 @@ project('C', 'c') -c = shared_library('c', 'c.c') +c = library('c', 'c.c') diff --git a/test cases/failing/16 extract from subproject/subprojects/sub_project/meson.build b/test cases/failing/16 extract from subproject/subprojects/sub_project/meson.build index e0073ea..0810df5 100644 --- a/test cases/failing/16 extract from subproject/subprojects/sub_project/meson.build +++ b/test cases/failing/16 extract from subproject/subprojects/sub_project/meson.build @@ -1,3 +1,3 @@ project('extract subproject object -- subproject', 'c') -lib = shared_library('sub_lib', 'sub_lib.c') +lib = library('sub_lib', 'sub_lib.c') diff --git a/test cases/fortran/21 install static/meson.build b/test cases/fortran/21 install static/meson.build index 14485f5..b4d3e40 100644 --- a/test cases/fortran/21 install static/meson.build +++ b/test cases/fortran/21 install static/meson.build @@ -3,7 +3,7 @@ # - Is an install:true static library to trigger certain codepath (promotion to link_whole) # - Does fortran code 'generation' with configure_file # - Uses .F90 ext (capital F typically denotes a dependence on preprocessor treatment, which however is not used) -project('try-static-subproject-dependency', 'fortran', default_options: ['default_library=static']) +project('try-static-subproject-dependency', 'fortran') static_dep = dependency('static_hello', fallback: ['static_hello', 'static_hello_dep']) diff --git a/test cases/fortran/21 install static/test.json b/test cases/fortran/21 install static/test.json index b31e91d..aff7147 100644 --- a/test cases/fortran/21 install static/test.json +++ b/test cases/fortran/21 install static/test.json @@ -1,5 +1,10 @@ { "installed": [ {"file": "usr/lib/libmainstatic.a", "type": "file"} - ] -}
\ No newline at end of file + ], + "matrix": { + "options": { + "default_library": [ { "val": "static" } ] + } + } +} diff --git a/test cases/frameworks/10 gtk-doc/meson.build b/test cases/frameworks/10 gtk-doc/meson.build index 292980f..43ee929 100644 --- a/test cases/frameworks/10 gtk-doc/meson.build +++ b/test cases/frameworks/10 gtk-doc/meson.build @@ -26,7 +26,7 @@ endif gobject = dependency('gobject-2.0') -libfoo = library('foo', 'foo.c', +libfoo = shared_library('foo', 'foo.c', include_directories: inc, dependencies: gobject, ) diff --git a/test cases/linuxlike/5 dependency versions/subprojects/somelib/meson.build b/test cases/linuxlike/5 dependency versions/subprojects/somelib/meson.build index 086e514..670b10f 100644 --- a/test cases/linuxlike/5 dependency versions/subprojects/somelib/meson.build +++ b/test cases/linuxlike/5 dependency versions/subprojects/somelib/meson.build @@ -1,7 +1,7 @@ # Define version only in project, should get inherited by declare_dependency project('some', 'c', version : '0.1') -somelib = shared_library('some', 'lib.c') +somelib = library('some', 'lib.c') someinc = include_directories('.') some_dep = declare_dependency(link_with : somelib, diff --git a/test cases/linuxlike/5 dependency versions/subprojects/somelibnover/meson.build b/test cases/linuxlike/5 dependency versions/subprojects/somelibnover/meson.build index 826bb3c..aa7e554 100644 --- a/test cases/linuxlike/5 dependency versions/subprojects/somelibnover/meson.build +++ b/test cases/linuxlike/5 dependency versions/subprojects/somelibnover/meson.build @@ -1,6 +1,6 @@ project('some', 'c') -somelib = shared_library('some', 'lib.c') +somelib = library('some', 'lib.c') someinc = include_directories('.') # Define version only in declare_dependency diff --git a/test cases/linuxlike/5 dependency versions/subprojects/somelibver/meson.build b/test cases/linuxlike/5 dependency versions/subprojects/somelibver/meson.build index ad9f243..c773814 100644 --- a/test cases/linuxlike/5 dependency versions/subprojects/somelibver/meson.build +++ b/test cases/linuxlike/5 dependency versions/subprojects/somelibver/meson.build @@ -1,6 +1,6 @@ project('some', 'c') -somelib = shared_library('some', 'lib.c') +somelib = library('some', 'lib.c') someinc = include_directories('.') # Define version only in declare_dependency diff --git a/test cases/rust/4 polyglot/meson.build b/test cases/rust/4 polyglot/meson.build index 4955516..4e96679 100644 --- a/test cases/rust/4 polyglot/meson.build +++ b/test cases/rust/4 polyglot/meson.build @@ -4,6 +4,6 @@ if host_machine.system() == 'darwin' error('MESON_SKIP_TEST: doesnt work right on macos, please fix!') endif -l = library('stuff', 'stuff.rs', rust_crate_type: 'cdylib', install : true) +l = shared_library('stuff', 'stuff.rs', rust_crate_type: 'cdylib', install : true) e = executable('prog', 'prog.c', link_with : l, install : true) test('polyglottest', e) |