diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-27 19:56:09 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-06-09 20:37:26 -0400 |
commit | c151988b397e15d67d83047a2e33d3df28353987 (patch) | |
tree | 0c57783bd8b7c9fda2d86ad8f598fa6593f70379 /mesonbuild/build.py | |
parent | e8a3f4d38c49ae7a937e0a02db06a73f5593b08f (diff) | |
download | meson-c151988b397e15d67d83047a2e33d3df28353987.zip meson-c151988b397e15d67d83047a2e33d3df28353987.tar.gz meson-c151988b397e15d67d83047a2e33d3df28353987.tar.bz2 |
intro-install_plan: fix destinations for build_targets with custom install_dir
There are a couple issues that combine to make the current handling a
bit confusing.
- we call it "install_dir_name" but it is only ever the class default
- CustomTarget always has it set to None, and then we check if it is
None then create a different variable with a safe fallback. The if is
useless -- it cannot fail, but if it did we'd get an undefined
variable error when we tried to use `dir_name`
Remove the special handling for CustomTarget. Instead, just always
accept None as a possible value of outdir_name when constructing install
data, and, if it is None, fall back to {prefix}/outdir regardless of
what type it used to be.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 245f612..3de5ef4 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -624,13 +624,14 @@ class Target(HoldableObject): def get_install_dir(self) -> T.Tuple[T.List[T.Union[str, Literal[False]]], str, Literal[False]]: # Find the installation directory. - default_install_dir, install_dir_name = self.get_default_install_dir() + default_install_dir, default_install_dir_name = self.get_default_install_dir() outdirs = self.get_custom_install_dir() if outdirs 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 + default_install_dir_name = None else: custom_install_dir = False # if outdirs is empty we need to set to something, otherwise we set @@ -640,7 +641,7 @@ class Target(HoldableObject): else: outdirs = [default_install_dir] - return outdirs, install_dir_name, custom_install_dir + return outdirs, default_install_dir_name, custom_install_dir def get_basename(self) -> str: return self.name |