@@ -1542,7 +1542,7 @@ def generate_target_install(self, d: InstallData) -> None:
1542
1542
for t in self .build .get_targets ().values ():
1543
1543
if not t .should_install ():
1544
1544
continue
1545
- outdirs , default_install_dir_name , custom_install_dir = t .get_install_dir ()
1545
+ outdirs , install_dir_names , custom_install_dir = t .get_install_dir ()
1546
1546
# Sanity-check the outputs and install_dirs
1547
1547
num_outdirs , num_out = len (outdirs ), len (t .get_outputs ())
1548
1548
if num_outdirs != 1 and num_outdirs != num_out :
@@ -1552,7 +1552,9 @@ def generate_target_install(self, d: InstallData) -> None:
1552
1552
raise MesonException (m .format (t .name , num_out , t .get_outputs (), num_outdirs ))
1553
1553
assert len (t .install_tag ) == num_out
1554
1554
install_mode = t .get_custom_install_mode ()
1555
- first_outdir = outdirs [0 ] # because mypy get's confused type narrowing in lists
1555
+ # because mypy get's confused type narrowing in lists
1556
+ first_outdir = outdirs [0 ]
1557
+ first_outdir_name = install_dir_names [0 ]
1556
1558
1557
1559
# Install the target output(s)
1558
1560
if isinstance (t , build .BuildTarget ):
@@ -1578,7 +1580,7 @@ def generate_target_install(self, d: InstallData) -> None:
1578
1580
tag = t .install_tag [0 ] or ('devel' if isinstance (t , build .StaticLibrary ) else 'runtime' )
1579
1581
mappings = t .get_link_deps_mapping (d .prefix )
1580
1582
i = TargetInstallData (self .get_target_filename (t ), first_outdir ,
1581
- default_install_dir_name ,
1583
+ first_outdir_name ,
1582
1584
should_strip , mappings , t .rpath_dirs_to_remove ,
1583
1585
t .install_rpath , install_mode , t .subproject ,
1584
1586
tag = tag , can_strip = can_strip )
@@ -1603,7 +1605,7 @@ def generate_target_install(self, d: InstallData) -> None:
1603
1605
implib_install_dir = self .environment .get_import_lib_dir ()
1604
1606
# Install the import library; may not exist for shared modules
1605
1607
i = TargetInstallData (self .get_target_filename_for_linking (t ),
1606
- implib_install_dir , default_install_dir_name ,
1608
+ implib_install_dir , first_outdir_name ,
1607
1609
False , {}, set (), '' , install_mode ,
1608
1610
t .subproject , optional = isinstance (t , build .SharedModule ),
1609
1611
tag = 'devel' )
@@ -1612,19 +1614,19 @@ def generate_target_install(self, d: InstallData) -> None:
1612
1614
if not should_strip and t .get_debug_filename ():
1613
1615
debug_file = os .path .join (self .get_target_dir (t ), t .get_debug_filename ())
1614
1616
i = TargetInstallData (debug_file , first_outdir ,
1615
- default_install_dir_name ,
1617
+ first_outdir_name ,
1616
1618
False , {}, set (), '' ,
1617
1619
install_mode , t .subproject ,
1618
1620
optional = True , tag = 'devel' )
1619
1621
d .targets .append (i )
1620
1622
# Install secondary outputs. Only used for Vala right now.
1621
1623
if num_outdirs > 1 :
1622
- for output , outdir , tag in zip (t .get_outputs ()[1 :], outdirs [1 :], t .install_tag [1 :]):
1624
+ for output , outdir , outdir_name , tag in zip (t .get_outputs ()[1 :], outdirs [ 1 :], install_dir_names [1 :], t .install_tag [1 :]):
1623
1625
# User requested that we not install this output
1624
1626
if outdir is False :
1625
1627
continue
1626
1628
f = os .path .join (self .get_target_dir (t ), output )
1627
- i = TargetInstallData (f , outdir , default_install_dir_name , False , {}, set (), None ,
1629
+ i = TargetInstallData (f , outdir , outdir_name , False , {}, set (), None ,
1628
1630
install_mode , t .subproject ,
1629
1631
tag = tag )
1630
1632
d .targets .append (i )
@@ -1643,18 +1645,18 @@ def generate_target_install(self, d: InstallData) -> None:
1643
1645
if first_outdir is not False :
1644
1646
for output , tag in zip (t .get_outputs (), t .install_tag ):
1645
1647
f = os .path .join (self .get_target_dir (t ), output )
1646
- i = TargetInstallData (f , first_outdir , default_install_dir_name ,
1648
+ i = TargetInstallData (f , first_outdir , first_outdir_name ,
1647
1649
False , {}, set (), None , install_mode ,
1648
1650
t .subproject , optional = not t .build_by_default ,
1649
1651
tag = tag )
1650
1652
d .targets .append (i )
1651
1653
else :
1652
- for output , outdir , tag in zip (t .get_outputs (), outdirs , t .install_tag ):
1654
+ for output , outdir , outdir_name , tag in zip (t .get_outputs (), outdirs , install_dir_names , t .install_tag ):
1653
1655
# User requested that we not install this output
1654
1656
if outdir is False :
1655
1657
continue
1656
1658
f = os .path .join (self .get_target_dir (t ), output )
1657
- i = TargetInstallData (f , outdir , default_install_dir_name ,
1659
+ i = TargetInstallData (f , outdir , outdir_name ,
1658
1660
False , {}, set (), None , install_mode ,
1659
1661
t .subproject , optional = not t .build_by_default ,
1660
1662
tag = tag )
0 commit comments