@ -324,6 +324,20 @@ a hard error in the future.''' % name)
self . build_always_stale = False
self . build_always_stale = False
self . option_overrides = { }
self . option_overrides = { }
def get_install_dir ( self , environment ) :
# Find the installation directory.
default_install_dir = self . get_default_install_dir ( environment )
outdirs = self . get_custom_install_dir ( )
if outdirs [ 0 ] is not None and outdirs [ 0 ] != default_install_dir and outdirs [ 0 ] is not True :
# Either the value is set to a non-default value, or is set to
# False (which means we want this specific output out of many
# outputs to not be installed).
custom_install_dir = True
else :
custom_install_dir = False
outdirs [ 0 ] = default_install_dir
return outdirs , custom_install_dir
def get_basename ( self ) :
def get_basename ( self ) :
return self . name
return self . name
@ -686,6 +700,9 @@ class BuildTarget(Target):
result . update ( i . get_link_dep_subdirs ( ) )
result . update ( i . get_link_dep_subdirs ( ) )
return result
return result
def get_default_install_dir ( self , environment ) :
return environment . get_libdir ( )
def get_custom_install_dir ( self ) :
def get_custom_install_dir ( self ) :
return self . install_dir
return self . install_dir
@ -1323,6 +1340,9 @@ class Executable(BuildTarget):
# Only linkwithable if using export_dynamic
# Only linkwithable if using export_dynamic
self . is_linkwithable = self . export_dynamic
self . is_linkwithable = self . export_dynamic
def get_default_install_dir ( self , environment ) :
return environment . get_bindir ( )
def description ( self ) :
def description ( self ) :
''' Human friendly description of the executable '''
''' Human friendly description of the executable '''
return self . name
return self . name
@ -1384,6 +1404,9 @@ class StaticLibrary(BuildTarget):
self . filename = self . prefix + self . name + ' . ' + self . suffix
self . filename = self . prefix + self . name + ' . ' + self . suffix
self . outputs = [ self . filename ]
self . outputs = [ self . filename ]
def get_default_install_dir ( self , environment ) :
return environment . get_static_lib_dir ( )
def type_suffix ( self ) :
def type_suffix ( self ) :
return " @sta "
return " @sta "
@ -1430,6 +1453,9 @@ class SharedLibrary(BuildTarget):
self . basic_filename_tpl = ' {0.prefix} {0.name} . {0.suffix} '
self . basic_filename_tpl = ' {0.prefix} {0.name} . {0.suffix} '
self . determine_filenames ( is_cross , environment )
self . determine_filenames ( is_cross , environment )
def get_default_install_dir ( self , environment ) :
return environment . get_shared_lib_dir ( )
def determine_filenames ( self , is_cross , env ) :
def determine_filenames ( self , is_cross , env ) :
"""
"""
See https : / / github . com / mesonbuild / meson / pull / 417 for details .
See https : / / github . com / mesonbuild / meson / pull / 417 for details .
@ -1701,6 +1727,10 @@ class SharedModule(SharedLibrary):
raise MesonException ( ' Shared modules must not specify the soversion kwarg. ' )
raise MesonException ( ' Shared modules must not specify the soversion kwarg. ' )
super ( ) . __init__ ( name , subdir , subproject , is_cross , sources , objects , environment , kwargs )
super ( ) . __init__ ( name , subdir , subproject , is_cross , sources , objects , environment , kwargs )
def get_default_install_dir ( self , environment ) :
return environment . get_shared_module_dir ( )
class CustomTarget ( Target ) :
class CustomTarget ( Target ) :
known_kwargs = set ( [
known_kwargs = set ( [
' input ' ,
' input ' ,
@ -1738,6 +1768,9 @@ class CustomTarget(Target):
mlog . warning ( ' Unknown keyword arguments in target %s : %s ' %
mlog . warning ( ' Unknown keyword arguments in target %s : %s ' %
( self . name , ' , ' . join ( unknowns ) ) )
( self . name , ' , ' . join ( unknowns ) ) )
def get_default_install_dir ( self , environment ) :
return None
def __lt__ ( self , other ) :
def __lt__ ( self , other ) :
return self . get_id ( ) < other . get_id ( )
return self . get_id ( ) < other . get_id ( )