diff options
27 files changed, 210 insertions, 87 deletions
diff --git a/ci/appveyor-install.bat b/ci/appveyor-install.bat index 2d4a8cb..1e60179 100755 --- a/ci/appveyor-install.bat +++ b/ci/appveyor-install.bat @@ -10,10 +10,13 @@ echo Updating Cygwin and installing ninja and test prerequisites %CYGWIN_ROOT%\%SETUP% -qnNdO -R "%CYGWIN_ROOT%" -s "%CYGWIN_MIRROR%" -l "%CACHE%" -g -P ^ gcc-objc++,^ gcc-objc,^ +gobject-introspection,^ libboost-devel,^ libglib2.0-devel,^ +libgtk3-devel,^ ninja,^ python3-pip,^ +vala,^ zlib-devel echo Install done diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index e30b79c..a231ed4 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -403,7 +403,7 @@ be passed to [shared and static libraries](#library). flags here for all platforms. - `link_depends` strings, files, or custom targets the link step depends on such as a symbol visibility map. The purpose is to - automaticallytrigger a re-link (but not a re-compile) of the target + automatically trigger a re-link (but not a re-compile) of the target when this file changes. - `link_whole` links all contents of the given static libraries whether they are used by not, equivalent to the @@ -412,13 +412,18 @@ be passed to [shared and static libraries](#library). - `link_with`, one or more shared or static libraries (built by this project) that this target should be linked with, If passed a list this list will be flattened as of 0.41.0. +- `export_dynamic` when set to true causes the target's symbols to be + dynamically exported, allowing modules built using the + [`shared_module`](#shared_module) function to refer to functions, + variables and other symbols defined in the executable itself. Implies + the `implib` argument. Since 0.44.0 - `implib` when set to true, an import library is generated for the executable (the name of the import library is based on *exe_name*). Alternatively, when set to a string, that gives the base name for the import library. The import library is used when the returned build target object appears in `link_with:` elsewhere. Only has any - effect on platforms where that is meaningful (e.g. Windows). Since - 0.42.0 + effect on platforms where that is meaningful (e.g. Windows). Implies + the `export_dynamic` argument. Since 0.42.0 - `implicit_include_directories` is a boolean telling whether Meson adds the current source and build directories to the include path, defaults to `true`, since 0.42.0 @@ -1010,6 +1015,11 @@ This is useful for building modules that will be `dlopen()`ed and hence may contain undefined symbols that will be provided by the library that is loading it. +If you want the shared module to be able to refer to functions and +variables defined in the [`executable`](#executable) it is loaded by, +you will need to set the `export_dynamic` argument of the executable to +`true`. + *Added 0.37.0* ### static_library() diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 1057892..2945d6a 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -42,8 +42,12 @@ def ninja_quote(text): for char in ('$', ' ', ':'): text = text.replace(char, '$' + char) if '\n' in text: - raise MesonException('Ninja does not support newlines in rules. ' - 'Please report this error with a test case to the Meson bug tracker.') + errmsg = '''Ninja does not support newlines in rules. The content was: + +%s + +Please report this error with a test case to the Meson bug tracker.''' % text + raise MesonException(errmsg) return text @@ -2254,7 +2258,7 @@ rule FORTRAN_DEP_HACK def generate_msvc_pch_command(self, target, compiler, pch): if len(pch) != 2: - raise RuntimeError('MSVC requires one header and one source to produce precompiled headers.') + raise MesonException('MSVC requires one header and one source to produce precompiled headers.') header = pch[0] source = pch[1] pchname = compiler.get_pch_name(header) @@ -2337,6 +2341,9 @@ rule FORTRAN_DEP_HACK # If gui_app, and that's significant on this platform if target.gui_app and hasattr(linker, 'get_gui_app_args'): commands += linker.get_gui_app_args() + # If export_dynamic, add the appropriate linker arguments + if target.export_dynamic: + commands += linker.gen_export_dynamic_link_args(self.environment) # If implib, and that's significant on this platform (i.e. Windows using either GCC or Visual Studio) if target.import_filename: commands += linker.gen_import_library_args(os.path.join(self.get_target_dir(target), target.import_filename)) diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 6a587ac..367f391 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -861,7 +861,14 @@ class Vs2010Backend(backends.Backend): if not pch: continue pch_node.text = 'Use' - pch_sources[lang] = [pch[0], pch[1], lang] + if compiler.id == 'msvc': + if len(pch) != 2: + raise MesonException('MSVC requires one header and one source to produce precompiled headers.') + pch_sources[lang] = [pch[0], pch[1], lang] + else: + # I don't know whether its relevant but let's handle other compilers + # used with a vs backend + pch_sources[lang] = [pch[0], None, lang] if len(pch_sources) == 1: # If there is only 1 language with precompiled headers, we can use it for the entire project, which # is cleaner than specifying it for each source file. @@ -1016,19 +1023,20 @@ class Vs2010Backend(backends.Backend): self.add_include_dirs(lang, inc_cl, file_inc_dirs) for lang in pch_sources: header, impl, suffix = pch_sources[lang] - relpath = os.path.join(proj_to_src_dir, impl) - inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=relpath) - pch = ET.SubElement(inc_cl, 'PrecompiledHeader') - pch.text = 'Create' - pch_out = ET.SubElement(inc_cl, 'PrecompiledHeaderOutputFile') - pch_out.text = '$(IntDir)$(TargetName)-%s.pch' % suffix - pch_file = ET.SubElement(inc_cl, 'PrecompiledHeaderFile') - # MSBuild searches for the header relative from the implementation, so we have to use - # just the file name instead of the relative path to the file. - pch_file.text = os.path.split(header)[1] - self.add_additional_options(lang, inc_cl, file_args) - self.add_preprocessor_defines(lang, inc_cl, file_defines) - self.add_include_dirs(lang, inc_cl, file_inc_dirs) + if impl: + relpath = os.path.join(proj_to_src_dir, impl) + inc_cl = ET.SubElement(inc_src, 'CLCompile', Include=relpath) + pch = ET.SubElement(inc_cl, 'PrecompiledHeader') + pch.text = 'Create' + pch_out = ET.SubElement(inc_cl, 'PrecompiledHeaderOutputFile') + pch_out.text = '$(IntDir)$(TargetName)-%s.pch' % suffix + pch_file = ET.SubElement(inc_cl, 'PrecompiledHeaderFile') + # MSBuild searches for the header relative from the implementation, so we have to use + # just the file name instead of the relative path to the file. + pch_file.text = os.path.split(header)[1] + self.add_additional_options(lang, inc_cl, file_args) + self.add_preprocessor_defines(lang, inc_cl, file_defines) + self.add_include_dirs(lang, inc_cl, file_inc_dirs) if self.has_objects(objects, additional_objects, gen_objs): inc_objs = ET.SubElement(root, 'ItemGroup') diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 8a2e716..16a18a9 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -82,6 +82,7 @@ known_lib_kwargs.update({'version': True, # Only for shared libs known_exe_kwargs = known_basic_kwargs.copy() known_exe_kwargs.update({'implib': True, + 'export_dynamic': True }) class InvalidArguments(MesonException): @@ -1160,23 +1161,33 @@ class Executable(BuildTarget): # The import library that GCC would generate (and prefer) self.gcc_import_filename = None - # if implib appears, this target is linkwith:-able, but that only means - # something on Windows platforms. - self.is_linkwithable = False - if 'implib' in kwargs and kwargs['implib']: + # Check for export_dynamic + self.export_dynamic = False + if kwargs.get('export_dynamic'): + if not isinstance(kwargs['export_dynamic'], bool): + raise InvalidArguments('"export_dynamic" keyword argument must be a boolean') + self.export_dynamic = True + if kwargs.get('implib'): + self.export_dynamic = True + if self.export_dynamic and kwargs.get('implib') is False: + raise InvalidArguments('"implib" keyword argument must not be false for if "export_dynamic" is true') + + # If using export_dynamic, set the import library name + if self.export_dynamic: implib_basename = self.name + '.exe' - if not isinstance(kwargs['implib'], bool): + if not isinstance(kwargs.get('implib', False), bool): implib_basename = kwargs['implib'] - self.is_linkwithable = True if for_windows(is_cross, environment) or for_cygwin(is_cross, environment): self.vs_import_filename = '{0}.lib'.format(implib_basename) self.gcc_import_filename = 'lib{0}.a'.format(implib_basename) - if self.get_using_msvc(): self.import_filename = self.vs_import_filename else: self.import_filename = self.gcc_import_filename + # Only linkwithable if using export_dynamic + self.is_linkwithable = self.export_dynamic + def type_suffix(self): return "@exe" diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 233fc84..4c6e3a2 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -183,6 +183,14 @@ class CCompiler(Compiler): def get_default_include_dirs(self): return [] + def gen_export_dynamic_link_args(self, env): + if for_windows(env.is_cross_build(), env): + return ['-Wl,--export-all-symbols'] + elif for_darwin(env.is_cross_build(), env): + return [] + else: + return ['-Wl,-export-dynamic'] + def gen_import_library_args(self, implibname): """ The name of the outputted import library diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 46cce43..b8787cc 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -400,11 +400,22 @@ class PkgConfigDependency(ExternalDependency): m = 'Invalid version of dependency, need {!r} {!r} found {!r}.' raise DependencyException(m.format(name, not_found, self.version)) return - found_msg += [mlog.green('YES'), self.version] - # Fetch cargs to be used while using this dependency - self._set_cargs() - # Fetch the libraries and library paths needed for using this - self._set_libs() + + try: + # Fetch cargs to be used while using this dependency + self._set_cargs() + # Fetch the libraries and library paths needed for using this + self._set_libs() + found_msg += [mlog.green('YES'), self.version] + except DependencyException as e: + if self.required: + raise + else: + self.compile_args = [] + self.link_args = [] + self.is_found = False + found_msg += [mlog.red('NO'), '; reason: {}'.format(str(e))] + # Print the found message only at the very end because fetching cflags # and libs can also fail if other needed pkg-config files aren't found. if not self.silent: diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 0c9a2f3..e5aa43e 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -731,7 +731,7 @@ class Environment: return compilers.LLVMDCompiler(exelist, version, is_cross, full_version=full_version) elif 'gdc' in out: return compilers.GnuDCompiler(exelist, version, is_cross, full_version=full_version) - elif 'Digital Mars' in out: + elif 'The D Language Foundation' in out or 'Digital Mars' in out: return compilers.DmdDCompiler(exelist, version, is_cross, full_version=full_version) raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 29b4033..488c2a3 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1347,7 +1347,7 @@ build_target_common_kwargs = ( rust_kwargs | cs_kwargs) -exe_kwargs = (build_target_common_kwargs) | {'implib'} +exe_kwargs = (build_target_common_kwargs) | {'implib', 'export_dynamic'} shlib_kwargs = (build_target_common_kwargs) | {'version', 'soversion'} shmod_kwargs = shlib_kwargs stlib_kwargs = shlib_kwargs @@ -1883,10 +1883,14 @@ to directly access options of other subprojects.''') raise InvalidCode('Second call to project().') if not self.is_subproject() and 'subproject_dir' in kwargs: spdirname = kwargs['subproject_dir'] - if '/' in spdirname or '\\' in spdirname: - raise InterpreterException('Subproject_dir must not contain a path segment.') + if not isinstance(spdirname, str): + raise InterpreterException('Subproject_dir must be a string') + if os.path.isabs(spdirname): + raise InterpreterException('Subproject_dir must not be an absolute path.') if spdirname.startswith('.'): raise InterpreterException('Subproject_dir must not begin with a period.') + if '..' in spdirname: + raise InterpreterException('Subproject_dir must not contain a ".." segment.') self.subproject_dir = spdirname if 'meson_version' in kwargs: diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index b7d2992..4871bf7 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -25,29 +25,40 @@ from glob import glob def detect_meson_py_location(): c = sys.argv[0] - c_fname = os.path.split(c)[1] - if c_fname == 'meson' or c_fname == 'meson.py': - # $ /foo/meson.py <args> - if os.path.isabs(c): - return c - # $ meson <args> (gets run from /usr/bin/meson) + c_dir, c_fname = os.path.split(c) + + # get the absolute path to the <mesontool> folder + m_dir = None + if os.path.isabs(c): + # $ /foo/<mesontool>.py <args> + m_dir = c_dir + elif c_dir == '': + # $ <mesontool> <args> (gets run from /usr/bin/<mesontool>) in_path_exe = shutil.which(c_fname) if in_path_exe: - # Special case: when run like "./meson.py <opts>" and user has - # period in PATH, we need to expand it out, because, for example, + m_dir, c_fname = os.path.split(in_path_exe) + # Special case: when run like "./meson.py <opts>", + # we need to expand it out, because, for example, # "ninja test" will be run from a different directory. - if '.' in os.environ['PATH'].split(':'): - p, f = os.path.split(in_path_exe) - if p == '' or p == '.': - return os.path.join(os.getcwd(), f) - return in_path_exe - # $ python3 ./meson.py <args> - if os.path.exists(c): - return os.path.join(os.getcwd(), c) - + if m_dir == '.': + m_dir = os.getcwd() + else: + m_dir = os.path.abspath(c_dir) + + # find meson in m_dir + if m_dir is not None: + for fname in ['meson', 'meson.py']: + m_path = os.path.join(m_dir, fname) + if os.path.exists(m_path): + return m_path + + # No meson found, which means that either: + # a) meson is not installed + # b) meson is installed to a non-standard location + # c) the script that invoked mesonlib is not the one of meson tools (e.g. run_unittests.py) # The only thing remaining is to try to find the bundled executable and # pray distro packagers have not moved it. - fname = os.path.join(os.path.dirname(__file__), '..', 'meson.py') + fname = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'meson.py')) if not os.path.exists(fname): raise RuntimeError('Could not determine how to run Meson. Please file a bug with details.') return fname diff --git a/run_project_tests.py b/run_project_tests.py index 68d2de5..d191e28 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -185,6 +185,7 @@ def get_relative_files_list_from_dir(fromdir): def platform_fix_name(fname, compiler): if '?lib' in fname: if mesonlib.is_cygwin(): + fname = re.sub(r'lib/\?lib(.*)\.so$', r'bin/cyg\1.dll', fname) fname = re.sub(r'\?lib(.*)\.dll$', r'cyg\1.dll', fname) else: fname = re.sub(r'\?lib', 'lib', fname) @@ -504,7 +505,11 @@ def detect_tests_to_run(): if mesonlib.is_windows(): # TODO: Set BOOST_ROOT in .appveyor.yml gathered_tests += [('framework', ['test cases/frameworks/1 boost'], 'BOOST_ROOT' not in os.environ)] - elif mesonlib.is_osx() or mesonlib.is_cygwin(): + elif mesonlib.is_osx(): + if os.path.exists('/usr/local/include/boost'): + # Just do the BOOST test + gathered_tests += [('framework', ['test cases/frameworks/1 boost'], False)] + elif mesonlib.is_cygwin(): # Just do the BOOST test gathered_tests += [('framework', ['test cases/frameworks/1 boost'], False)] else: diff --git a/test cases/common/125 shared module/meson.build b/test cases/common/125 shared module/meson.build index 29277e9..08a284d 100644 --- a/test cases/common/125 shared module/meson.build +++ b/test cases/common/125 shared module/meson.build @@ -8,6 +8,6 @@ l = shared_library('runtime', 'runtime.c') # at runtime. This requires extra help on Windows, so # should be avoided unless really necessary. m = shared_module('mymodule', 'module.c') -e = executable('prog', 'prog.c', link_with : l, dependencies : dl) +e = executable('prog', 'prog.c', + link_with : l, export_dynamic : true, dependencies : dl) test('import test', e, args : m) - diff --git a/test cases/common/156 shared module resolving symbol in executable/meson.build b/test cases/common/156 shared module resolving symbol in executable/meson.build index 34a75f1..282a4d2 100644 --- a/test cases/common/156 shared module resolving symbol in executable/meson.build +++ b/test cases/common/156 shared module resolving symbol in executable/meson.build @@ -9,13 +9,7 @@ project('shared module resolving symbol in executable', 'c') # See testcase 125 for an example of the more complex portability gymnastics # required if we do not know (at link-time) what provides the symbol. -link_flags = [] -if host_machine.system() != 'windows' - # Needed to export dynamic symbols from the executable - link_flags += ['-rdynamic'] -endif - dl = meson.get_compiler('c').find_library('dl', required: false) -e = executable('prog', 'prog.c', dependencies: dl, implib: true, link_args: link_flags) +e = executable('prog', 'prog.c', dependencies: dl, export_dynamic: true) m = shared_module('module', 'module.c', link_with: e) test('test', e, args: m.full_path()) diff --git a/test cases/frameworks/11 gir subproject/gir/meson.build b/test cases/frameworks/11 gir subproject/gir/meson.build index 48e0a47..fe40dc6 100644 --- a/test cases/frameworks/11 gir subproject/gir/meson.build +++ b/test cases/frameworks/11 gir subproject/gir/meson.build @@ -31,6 +31,9 @@ message('TEST: ' + girsubproject.outdir()) envdata = environment() envdata.append('GI_TYPELIB_PATH', girsubproject.outdir(), 'subprojects/mesongir', separator : ':') envdata.append('LD_LIBRARY_PATH', girsubproject.outdir(), 'subprojects/mesongir') +if ['windows', 'cygwin'].contains(host_machine.system()) + envdata.append('PATH', girsubproject.outdir(), 'subprojects/mesongir') +endif test('gobject introspection/subproject/c', girexe) test('gobject introspection/subproject/py', find_program('prog.py'), diff --git a/test cases/frameworks/11 gir subproject/installed_files.txt b/test cases/frameworks/11 gir subproject/installed_files.txt index 434481e..87d49a1 100644 --- a/test cases/frameworks/11 gir subproject/installed_files.txt +++ b/test cases/frameworks/11 gir subproject/installed_files.txt @@ -2,5 +2,5 @@ usr/lib/girepository-1.0/Meson-1.0.typelib usr/lib/girepository-1.0/MesonSub-1.0.typelib usr/share/gir-1.0/Meson-1.0.gir usr/share/gir-1.0/MesonSub-1.0.gir -usr/lib/libgirsubproject.so -usr/lib/libgirlib.so +usr/lib/?libgirsubproject.so +usr/lib/?libgirlib.so diff --git a/test cases/frameworks/12 multiple gir/installed_files.txt b/test cases/frameworks/12 multiple gir/installed_files.txt index 9fb51bf..a5d16bc 100644 --- a/test cases/frameworks/12 multiple gir/installed_files.txt +++ b/test cases/frameworks/12 multiple gir/installed_files.txt @@ -1,6 +1,6 @@ usr/lib/girepository-1.0/Meson-1.0.typelib usr/lib/girepository-1.0/MesonSub-1.0.typelib -usr/lib/libgirlib.so -usr/lib/libgirsubproject.so +usr/lib/?libgirlib.so +usr/lib/?libgirsubproject.so usr/share/gir-1.0/Meson-1.0.gir usr/share/gir-1.0/MesonSub-1.0.gir diff --git a/test cases/frameworks/7 gnome/gir/meson.build b/test cases/frameworks/7 gnome/gir/meson.build index a91cb97..1771548 100644 --- a/test cases/frameworks/7 gnome/gir/meson.build +++ b/test cases/frameworks/7 gnome/gir/meson.build @@ -41,5 +41,8 @@ gir_paths = ':'.join([girlib.outdir(), dep1lib.outdir(), dep2lib.outdir()]) envdata = environment() envdata.append('GI_TYPELIB_PATH', gir_paths, separator : ':') envdata.append('LD_LIBRARY_PATH', gir_paths) +if ['windows', 'cygwin'].contains(host_machine.system()) + envdata.append('PATH', gir_paths) +endif test('gobject introspection/py', find_program('prog.py'), env : envdata) diff --git a/test cases/frameworks/7 gnome/installed_files.txt b/test cases/frameworks/7 gnome/installed_files.txt index d0d51d5..c7c704f 100644 --- a/test cases/frameworks/7 gnome/installed_files.txt +++ b/test cases/frameworks/7 gnome/installed_files.txt @@ -2,9 +2,9 @@ usr/include/enums.h usr/include/enums2.h usr/include/enums3.h usr/include/marshaller.h -usr/lib/libgir_lib.so -usr/lib/libdep1lib.so -usr/lib/libdep2lib.so +usr/lib/?libgir_lib.so +usr/lib/?libdep1lib.so +usr/lib/?libdep2lib.so usr/lib/girepository-1.0/Meson-1.0.typelib usr/lib/girepository-1.0/MesonDep1-1.0.typelib usr/lib/girepository-1.0/MesonDep2-1.0.typelib diff --git a/test cases/vala/11 generated vapi/installed_files.txt b/test cases/vala/11 generated vapi/installed_files.txt index 5993d01..aeaf2da 100644 --- a/test cases/vala/11 generated vapi/installed_files.txt +++ b/test cases/vala/11 generated vapi/installed_files.txt @@ -1,6 +1,6 @@ usr/bin/vapigen-test -usr/lib/libfoo.so -usr/lib/libbar.so +usr/lib/?libfoo.so +usr/lib/?libbar.so usr/share/vala/vapi/foo-1.0.vapi usr/share/vala/vapi/foo-1.0.deps usr/share/vala/vapi/bar-1.0.vapi diff --git a/test cases/vala/11 generated vapi/libbar/bar.c b/test cases/vala/11 generated vapi/libbar/bar.c index f0f5cb8..3037141 100644 --- a/test cases/vala/11 generated vapi/libbar/bar.c +++ b/test cases/vala/11 generated vapi/libbar/bar.c @@ -1,12 +1,29 @@ #include "bar.h" #include "foo.h" +struct _BarBar +{ + GObject parent_instance; +}; + +G_DEFINE_TYPE (BarBar, bar_bar, G_TYPE_OBJECT) + +static void +bar_bar_class_init (BarBarClass *klass) +{ +} + +static void +bar_bar_init (BarBar *self) +{ +} + /** - * bar_return_success: + * bar_bar_return_success: * * Returns 0 */ -int bar_return_success(void) +int bar_bar_return_success(void) { - return foo_return_success(); + return foo_foo_return_success(); } diff --git a/test cases/vala/11 generated vapi/libbar/bar.h b/test cases/vala/11 generated vapi/libbar/bar.h index 165b104..4ca7270 100644 --- a/test cases/vala/11 generated vapi/libbar/bar.h +++ b/test cases/vala/11 generated vapi/libbar/bar.h @@ -2,4 +2,8 @@ #pragma once -int bar_return_success(void); +#define BAR_TYPE_BAR (bar_bar_get_type()) + +G_DECLARE_FINAL_TYPE (BarBar, bar_bar, BAR, BAR, GObject) + +int bar_bar_return_success(void); diff --git a/test cases/vala/11 generated vapi/libfoo/foo.c b/test cases/vala/11 generated vapi/libfoo/foo.c index 0413ac5..dd2b891 100644 --- a/test cases/vala/11 generated vapi/libfoo/foo.c +++ b/test cases/vala/11 generated vapi/libfoo/foo.c @@ -1,11 +1,28 @@ #include "foo.h" +struct _FooFoo +{ + GObject parent_instance; +}; + +G_DEFINE_TYPE (FooFoo, foo_foo, G_TYPE_OBJECT) + +static void +foo_foo_class_init (FooFooClass *klass) +{ +} + +static void +foo_foo_init (FooFoo *self) +{ +} + /** - * foo_return_success: + * foo_foo_return_success: * * Returns 0 */ -int foo_return_success(void) +int foo_foo_return_success(void) { - return 0; + return 0; } diff --git a/test cases/vala/11 generated vapi/libfoo/foo.h b/test cases/vala/11 generated vapi/libfoo/foo.h index f09256d..e1887d8 100644 --- a/test cases/vala/11 generated vapi/libfoo/foo.h +++ b/test cases/vala/11 generated vapi/libfoo/foo.h @@ -2,4 +2,8 @@ #pragma once -int foo_return_success(void); +#define FOO_TYPE_FOO (foo_foo_get_type()) + +G_DECLARE_FINAL_TYPE (FooFoo, foo_foo, Foo, FOO, GObject) + +int foo_foo_return_success(void); diff --git a/test cases/vala/11 generated vapi/main.vala b/test cases/vala/11 generated vapi/main.vala index 303ab33..d61fba0 100644 --- a/test cases/vala/11 generated vapi/main.vala +++ b/test cases/vala/11 generated vapi/main.vala @@ -3,7 +3,7 @@ using Bar; class Main : GLib.Object { public static int main(string[] args) { - var ignore = Foo.return_success(); - return Bar.return_success(); + var ignore = Foo.Foo.return_success(); + return Bar.Bar.return_success(); } } diff --git a/test cases/vala/7 shared library/installed_files.txt b/test cases/vala/7 shared library/installed_files.txt index f70e439..012b107 100644 --- a/test cases/vala/7 shared library/installed_files.txt +++ b/test cases/vala/7 shared library/installed_files.txt @@ -1,5 +1,5 @@ -usr/lib/libinstalled_vala_lib.so -usr/lib/libinstalled_vala_all.so +usr/lib/?libinstalled_vala_lib.so +usr/lib/?libinstalled_vala_all.so usr/include/installed_vala_all.h usr/include/valah/installed_vala_all_nolib.h usr/include/installed_vala_onlyh.h diff --git a/test cases/vala/9 gir/installed_files.txt b/test cases/vala/9 gir/installed_files.txt index 7a0e055..64bddee 100644 --- a/test cases/vala/9 gir/installed_files.txt +++ b/test cases/vala/9 gir/installed_files.txt @@ -1,2 +1,2 @@ -usr/lib/libfoo.so +usr/lib/?libfoo.so usr/share/gir-1.0/Foo-1.0.gir diff --git a/wraptool.py b/wraptool.py index 5e03efd..a5ee9ef 100755 --- a/wraptool.py +++ b/wraptool.py @@ -17,4 +17,7 @@ from mesonbuild.wrap import wraptool import sys -sys.exit(wraptool.run(sys.argv[1:])) +if __name__ == '__main__': + print('Warning: This executable is deprecated. Use "meson wrap" instead.', + file=sys.stderr) + sys.exit(wraptool.run(sys.argv[1:])) |