aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-12-08 10:26:03 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-01-11 11:15:06 -0800
commit3949c2a0e0a5fbd9ede8e7a4607220e58934637e (patch)
treedba36fce500be660e186787d58bdaae3e1e8bd39 /mesonbuild/cmake
parent284b89c3217688ac09b79463a20e4099d7c158b9 (diff)
downloadmeson-3949c2a0e0a5fbd9ede8e7a4607220e58934637e.zip
meson-3949c2a0e0a5fbd9ede8e7a4607220e58934637e.tar.gz
meson-3949c2a0e0a5fbd9ede8e7a4607220e58934637e.tar.bz2
move CMAKE_PREFIX_PATH env var handling to environment
This causes the variable to be read up front and stored, rather than be re-read on each invocation of meson. This does have two slight behavioral changes. First is the obvious one that changing the variable between `meson --reconfigure` invocations has no effect. This is the way PKG_CONFIG_PATH already works. The second change is that CMAKE_PREFIX_PATH the env var is no longer appended to the values set in the machine file or on the command line, and is instead replaced by them. CMAKE_PREFIX_PATH is the only env var in meson that works this way, every other one is replaced not appended, so while this is a behavioral change, I also think its a bug fix.
Diffstat (limited to 'mesonbuild/cmake')
-rw-r--r--mesonbuild/cmake/executor.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py
index 674b854..e4b85de 100644
--- a/mesonbuild/cmake/executor.py
+++ b/mesonbuild/cmake/executor.py
@@ -24,7 +24,6 @@ import os
from .. import mlog
from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice, is_windows, OptionKey
-from ..envconfig import get_env_var
if T.TYPE_CHECKING:
from ..environment import Environment
@@ -63,23 +62,6 @@ class CMakeExecutor:
return
self.prefix_paths = self.environment.coredata.options[OptionKey('cmake_prefix_path', machine=self.for_machine)].value
- env_pref_path_raw = get_env_var(
- self.for_machine,
- self.environment.is_cross_build(),
- 'CMAKE_PREFIX_PATH')
- if env_pref_path_raw is not None:
- env_pref_path = [] # type: T.List[str]
- if is_windows():
- # Cannot split on ':' on Windows because its in the drive letter
- env_pref_path = env_pref_path_raw.split(os.pathsep)
- else:
- # https://github.com/mesonbuild/meson/issues/7294
- env_pref_path = re.split(r':|;', env_pref_path_raw)
- env_pref_path = [x for x in env_pref_path if x] # Filter out empty strings
- if not self.prefix_paths:
- self.prefix_paths = []
- self.prefix_paths += env_pref_path
-
if self.prefix_paths:
self.extra_cmake_args += ['-DCMAKE_PREFIX_PATH={}'.format(';'.join(self.prefix_paths))]