diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2018-11-17 19:45:52 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-21 21:36:39 +0200 |
commit | 443a4a8c78a41653abc78dabbb664739c2811d02 (patch) | |
tree | 5115aa7337b71ffb2d938836ee2ee82c9e8d93c3 /mesonbuild/modules/pkgconfig.py | |
parent | 5e91eb3d0c6750bc70504c02ca942f69aeb46178 (diff) | |
download | meson-443a4a8c78a41653abc78dabbb664739c2811d02.zip meson-443a4a8c78a41653abc78dabbb664739c2811d02.tar.gz meson-443a4a8c78a41653abc78dabbb664739c2811d02.tar.bz2 |
pkgconfig: add support for pkgconfig generation for c#
this adds support for generating pkgconfig files for c#.
The difference to c and cpp is that the -I flag is not known to the c#
compiler, but rather the -r flag which is used to link a .dll file into
the compiled library.
However this opens the question of validating which pkgconfig files can
be generated (depending on the language).
This implements 4409.
Diffstat (limited to 'mesonbuild/modules/pkgconfig.py')
-rw-r--r-- | mesonbuild/modules/pkgconfig.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 8684864..52285c2 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -276,10 +276,16 @@ class PkgConfigModule(ExtensionModule): install_dir = l.get_custom_install_dir()[0] if install_dir is False: continue - if isinstance(install_dir, str): - Lflag = '-L${prefix}/%s ' % self._escape(self._make_relative(prefix, install_dir)) - else: # install_dir is True - Lflag = '-L${libdir}' + if 'cs' in l.compilers: + if isinstance(install_dir, str): + Lflag = '-r${prefix}/%s/%s ' % (self._escape(self._make_relative(prefix, install_dir)), l.filename) + else: # install_dir is True + Lflag = '-r${libdir}/%s' % l.filename + else: + if isinstance(install_dir, str): + Lflag = '-L${prefix}/%s ' % self._escape(self._make_relative(prefix, install_dir)) + else: # install_dir is True + Lflag = '-L${libdir}' if Lflag not in Lflags: Lflags.append(Lflag) yield Lflag @@ -288,7 +294,8 @@ class PkgConfigModule(ExtensionModule): # find the library if l.name_suffix_set: mlog.warning(msg.format(l.name, 'name_suffix', lname, pcfile)) - yield '-l%s' % lname + if 'cs' not in l.compilers: + yield '-l%s' % lname if len(deps.pub_libs) > 0: ofile.write('Libs: {}\n'.format(' '.join(generate_libs_flags(deps.pub_libs)))) |