|
|
@ -20,6 +20,7 @@ import itertools, pathlib |
|
|
|
import os |
|
|
|
import os |
|
|
|
import pickle |
|
|
|
import pickle |
|
|
|
import re |
|
|
|
import re |
|
|
|
|
|
|
|
import textwrap |
|
|
|
import typing as T |
|
|
|
import typing as T |
|
|
|
|
|
|
|
|
|
|
|
from . import environment |
|
|
|
from . import environment |
|
|
@ -464,9 +465,11 @@ class Target: |
|
|
|
def __init__(self, name: str, subdir: str, subproject: str, build_by_default: bool, for_machine: MachineChoice): |
|
|
|
def __init__(self, name: str, subdir: str, subproject: str, build_by_default: bool, for_machine: MachineChoice): |
|
|
|
if has_path_sep(name): |
|
|
|
if has_path_sep(name): |
|
|
|
# Fix failing test 53 when this becomes an error. |
|
|
|
# Fix failing test 53 when this becomes an error. |
|
|
|
mlog.warning(f'''Target "{name}" has a path separator in its name. |
|
|
|
mlog.warning(textwrap.dedent(f'''\ |
|
|
|
This is not supported, it can cause unexpected failures and will become |
|
|
|
Target "{name}" has a path separator in its name. |
|
|
|
a hard error in the future.''') |
|
|
|
This is not supported, it can cause unexpected failures and will become |
|
|
|
|
|
|
|
a hard error in the future.\ |
|
|
|
|
|
|
|
''')) |
|
|
|
self.name = name |
|
|
|
self.name = name |
|
|
|
self.subdir = subdir |
|
|
|
self.subdir = subdir |
|
|
|
self.subproject = subproject |
|
|
|
self.subproject = subproject |
|
|
@ -959,11 +962,13 @@ class BuildTarget(Target): |
|
|
|
llist = extract_as_list(kwargs, 'link_with') |
|
|
|
llist = extract_as_list(kwargs, 'link_with') |
|
|
|
for linktarget in unholder(llist): |
|
|
|
for linktarget in unholder(llist): |
|
|
|
if isinstance(linktarget, dependencies.ExternalLibrary): |
|
|
|
if isinstance(linktarget, dependencies.ExternalLibrary): |
|
|
|
raise MesonException('''An external library was used in link_with keyword argument, which |
|
|
|
raise MesonException(textwrap.dedent('''\ |
|
|
|
is reserved for libraries built as part of this project. External |
|
|
|
An external library was used in link_with keyword argument, which |
|
|
|
libraries must be passed using the dependencies keyword argument |
|
|
|
is reserved for libraries built as part of this project. External |
|
|
|
instead, because they are conceptually "external dependencies", |
|
|
|
libraries must be passed using the dependencies keyword argument |
|
|
|
just like those detected with the dependency() function.''') |
|
|
|
instead, because they are conceptually "external dependencies", |
|
|
|
|
|
|
|
just like those detected with the dependency() function.\ |
|
|
|
|
|
|
|
''')) |
|
|
|
self.link(linktarget) |
|
|
|
self.link(linktarget) |
|
|
|
lwhole = extract_as_list(kwargs, 'link_whole') |
|
|
|
lwhole = extract_as_list(kwargs, 'link_whole') |
|
|
|
for linktarget in lwhole: |
|
|
|
for linktarget in lwhole: |
|
|
@ -1012,8 +1017,11 @@ just like those detected with the dependency() function.''') |
|
|
|
raise InvalidArguments('Link_args arguments must be strings.') |
|
|
|
raise InvalidArguments('Link_args arguments must be strings.') |
|
|
|
for l in self.link_args: |
|
|
|
for l in self.link_args: |
|
|
|
if '-Wl,-rpath' in l or l.startswith('-rpath'): |
|
|
|
if '-Wl,-rpath' in l or l.startswith('-rpath'): |
|
|
|
mlog.warning('''Please do not define rpath with a linker argument, use install_rpath or build_rpath properties instead. |
|
|
|
mlog.warning(textwrap.dedent('''\ |
|
|
|
This will become a hard error in a future Meson release.''') |
|
|
|
Please do not define rpath with a linker argument, use install_rpath |
|
|
|
|
|
|
|
or build_rpath properties instead. |
|
|
|
|
|
|
|
This will become a hard error in a future Meson release.\ |
|
|
|
|
|
|
|
''')) |
|
|
|
self.process_link_depends(kwargs.get('link_depends', []), environment) |
|
|
|
self.process_link_depends(kwargs.get('link_depends', []), environment) |
|
|
|
# Target-specific include dirs must be added BEFORE include dirs from |
|
|
|
# Target-specific include dirs must be added BEFORE include dirs from |
|
|
|
# internal deps (added inside self.add_deps()) to override them. |
|
|
|
# internal deps (added inside self.add_deps()) to override them. |
|
|
|