(self, env)
See https://github.com/mesonbuild/meson/pull/417 for details.

        First we determine the filename template (self.filename_tpl), then we
        set the output filename (self.filename).

        The template is needed while creating aliases (self.get_aliases),
        which are needed while generating .so shared libraries for Linux.

        Besides this, there's also the import library name, which is only used
        on Windows since on that platform the linker uses a separate library
        called the "import library" during linking instead of the shared
        library (DLL). The toolchain will output an import library in one of
        two formats: GCC or Visual Studio.

        When we're building with Visual Studio, the import library that will be
        generated by the toolchain is self.vs_import_filename, and with
        MinGW/GCC, it's self.gcc_import_filename. self.import_filename will
        always contain the import library name this target will generate.
See https://github.com/mesonbuild/meson/pull/417 for details.
See https : // github . com / mesonbuild / meson / pull / 417 for details .
def determine_filenames(self, env):
        """
        See https://github.com/mesonbuild/meson/pull/417 for details.

        First we determine the filename template (self.filename_tpl), then we
        set the output filename (self.filename).

        The template is needed while creating aliases (self.get_aliases),
        which are needed while generating .so shared libraries for Linux.

        Besides this, there's also the import library name, which is only used
        on Windows since on that platform the linker uses a separate library
        called the "import library" during linking instead of the shared
        library (DLL). The toolchain will output an import library in one of
        two formats: GCC or Visual Studio.

        When we're building with Visual Studio, the import library that will be
        generated by the toolchain is self.vs_import_filename, and with
        MinGW/GCC, it's self.gcc_import_filename. self.import_filename will
        always contain the import library name this target will generate.
        """
        prefix = ''
        suffix = ''
        create_debug_file = False
        self.filename_tpl = self.basic_filename_tpl
        # NOTE: manual prefix/suffix override is currently only tested for C/C++
        # C# and Mono
        if 'cs' in self.compilers:
            prefix = ''
            suffix = 'dll'
            self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
            create_debug_file = True
        # C, C++, Swift, Vala
        # Only Windows uses a separate import library for linking
        # For all other targets/platforms import_filename stays None
        elif env.machines[self.for_machine].is_windows():
            suffix = 'dll'
            self.vs_import_filename = '{}{}.lib'.format(self.prefix if self.prefix is not None else '', self.name)
            self.gcc_import_filename = '{}{}.dll.a'.format(self.prefix if self.prefix is not None else 'lib', self.name)
            if self.uses_rust():
                # Shared library is of the form foo.dll
                prefix = ''
                # Import library is called foo.dll.lib
                self.import_filename = f'{self.name}.dll.lib'
                create_debug_file = True
            elif self.get_using_msvc():
                # Shared library is of the form foo.dll
                prefix = ''
                # Import library is called foo.lib
                self.import_filename = self.vs_import_filename
                create_debug_file = True
            # Assume GCC-compatible naming
            else:
                # Shared library is of the form libfoo.dll
                prefix = 'lib'
                # Import library is called libfoo.dll.a
                self.import_filename = self.gcc_import_filename
            # Shared library has the soversion if it is defined
            if self.soversion:
                self.filename_tpl = '{0.prefix}{0.name}-{0.soversion}.{0.suffix}'
            else:
                self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
        elif env.machines[self.for_machine].is_cygwin():
            suffix = 'dll'
            self.gcc_import_filename = '{}{}.dll.a'.format(self.prefix if self.prefix is not None else 'lib', self.name)
            # Shared library is of the form cygfoo.dll
            # (ld --dll-search-prefix=cyg is the default)
            prefix = 'cyg'
            # Import library is called libfoo.dll.a
            self.import_filename = self.gcc_import_filename
            if self.soversion:
                self.filename_tpl = '{0.prefix}{0.name}-{0.soversion}.{0.suffix}'
            else:
                self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
        elif env.machines[self.for_machine].is_darwin():
            prefix = 'lib'
            suffix = 'dylib'
            # On macOS, the filename can only contain the major version
            if self.soversion:
                # libfoo.X.dylib
                self.filename_tpl = '{0.prefix}{0.name}.{0.soversion}.{0.suffix}'
            else:
                # libfoo.dylib
                self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
        elif env.machines[self.for_machine].is_android():
            prefix = 'lib'
            suffix = 'so'
            # Android doesn't support shared_library versioning
            self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
        else:
            prefix = 'lib'
            suffix = 'so'
            if self.ltversion:
                # libfoo.so.X[.Y[.Z]] (.Y and .Z are optional)
                self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}.{0.ltversion}'
            elif self.soversion:
                # libfoo.so.X
                self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}.{0.soversion}'
            else:
                # No versioning, libfoo.so
                self.filename_tpl = '{0.prefix}{0.name}.{0.suffix}'
        if self.prefix is None:
            self.prefix = prefix
        if self.suffix is None:
            self.suffix = suffix
        self.filename = self.filename_tpl.format(self)
        self.outputs = [self.filename]
        if create_debug_file:
            self.debug_filename = os.path.splitext(self.filename)[0] + '.pdb'
def determine_filenames ( self , env ) : prefix = '' suffix = '' create_debug_file = False self . filename_tpl = self . basic_filename_tpl # NOTE: manual prefix/suffix override is currently only tested for C/C++ # C# and Mono if 'cs' in self . compilers : prefix = '' suffix = 'dll' self . filename_tpl = '{0.prefix}{0.name}.{0.suffix}' create_debug_file = True # C, C++, Swift, Vala # Only Windows uses a separate import library for linking # For all other targets/platforms import_filename stays None elif env . machines [ self . for_machine ] . is_windows ( ) : suffix = 'dll' self . vs_import_filename = '{}{}.lib' . format ( self . prefix if self . prefix is not None else '' , self . name ) self . gcc_import_filename = '{}{}.dll.a' . format ( self . prefix if self . prefix is not None else 'lib' , self . name ) if self . uses_rust ( ) : # Shared library is of the form foo.dll prefix = '' # Import library is called foo.dll.lib self . import_filename = f'{self.name}.dll.lib' create_debug_file = True elif self . get_using_msvc ( ) : # Shared library is of the form foo.dll prefix = '' # Import library is called foo.lib self . import_filename = self . vs_import_filename create_debug_file = True # Assume GCC-compatible naming else : # Shared library is of the form libfoo.dll prefix = 'lib' # Import library is called libfoo.dll.a self . import_filename = self . gcc_import_filename # Shared library has the soversion if it is defined if self . soversion : self . filename_tpl = '{0.prefix}{0.name}-{0.soversion}.{0.suffix}' else : self . filename_tpl = '{0.prefix}{0.name}.{0.suffix}' elif env . machines [ self . for_machine ] . is_cygwin ( ) : suffix = 'dll' self . gcc_import_filename = '{}{}.dll.a' . format ( self . prefix if self . prefix is not None else 'lib' , self . name ) # Shared library is of the form cygfoo.dll # (ld --dll-search-prefix=cyg is the default) prefix = 'cyg' # Import library is called libfoo.dll.a self . import_filename = self . gcc_import_filename if self . soversion : self . filename_tpl = '{0.prefix}{0.name}-{0.soversion}.{0.suffix}' else : self . filename_tpl = '{0.prefix}{0.name}.{0.suffix}' elif env . machines [ self . for_machine ] . is_darwin ( ) : prefix = 'lib' suffix = 'dylib' # On macOS, the filename can only contain the major version if self . soversion : # libfoo.X.dylib self . filename_tpl = '{0.prefix}{0.name}.{0.soversion}.{0.suffix}' else : # libfoo.dylib self . filename_tpl = '{0.prefix}{0.name}.{0.suffix}' elif env . machines [ self . for_machine ] . is_android ( ) : prefix = 'lib' suffix = 'so' # Android doesn't support shared_library versioning self . filename_tpl = '{0.prefix}{0.name}.{0.suffix}' else : prefix = 'lib' suffix = 'so' if self . ltversion : # libfoo.so.X[.Y[.Z]] (.Y and .Z are optional) self . filename_tpl = '{0.prefix}{0.name}.{0.suffix}.{0.ltversion}' elif self . soversion : # libfoo.so.X self . filename_tpl = '{0.prefix}{0.name}.{0.suffix}.{0.soversion}' else : # No versioning, libfoo.so self . filename_tpl = '{0.prefix}{0.name}.{0.suffix}' if self . prefix is None : self . prefix = prefix if self . suffix is None : self . suffix = suffix self . filename = self . filename_tpl . format ( self ) self . outputs = [ self . filename ] if create_debug_file : self . debug_filename = os . path . splitext ( self . filename ) [ 0 ] + '.pdb'