aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/client.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-10-13 23:38:51 +0300
committerGitHub <noreply@github.com>2020-10-13 23:38:51 +0300
commit3372c58ca633e2bc7d5b36bcd7e0d14d12e0f82a (patch)
treee0af9977e708170d136104e4eb056b6f9f31eda0 /mesonbuild/cmake/client.py
parent55cf399ff8b9c15300f26dd1a46045dda7d49f98 (diff)
parentf5c9bf96b370832fc1a6e50771e2c171de0cd79d (diff)
downloadmeson-3372c58ca633e2bc7d5b36bcd7e0d14d12e0f82a.zip
meson-3372c58ca633e2bc7d5b36bcd7e0d14d12e0f82a.tar.gz
meson-3372c58ca633e2bc7d5b36bcd7e0d14d12e0f82a.tar.bz2
Merge pull request #7816 from mensinda/cmCross
cmake: Cross compilation support
Diffstat (limited to 'mesonbuild/cmake/client.py')
-rw-r--r--mesonbuild/cmake/client.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/mesonbuild/cmake/client.py b/mesonbuild/cmake/client.py
index ce79e8e..8f9456b 100644
--- a/mesonbuild/cmake/client.py
+++ b/mesonbuild/cmake/client.py
@@ -16,8 +16,6 @@
# or an interpreter-based tool.
from .common import CMakeException, CMakeConfiguration, CMakeBuildFile
-from .executor import CMakeExecutor
-from ..mesonlib import MachineChoice
from .. import mlog
from contextlib import contextmanager
from subprocess import Popen, PIPE, TimeoutExpired
@@ -27,6 +25,7 @@ import json
if T.TYPE_CHECKING:
from ..environment import Environment
+ from .executor import CMakeExecutor
CMAKE_SERVER_BEGIN_STR = '[== "CMake Server" ==['
CMAKE_SERVER_END_STR = ']== "CMake Server" ==]'
@@ -331,20 +330,17 @@ class CMakeClient:
return ReplyCMakeInputs(data['cookie'], Path(data['cmakeRootDirectory']), Path(data['sourceDirectory']), files)
@contextmanager
- def connect(self) -> T.Generator[None, None, None]:
- self.startup()
+ def connect(self, cmake_exe: 'CMakeExecutor') -> T.Generator[None, None, None]:
+ self.startup(cmake_exe)
try:
yield
finally:
self.shutdown()
- def startup(self) -> None:
+ def startup(self, cmake_exe: 'CMakeExecutor') -> None:
if self.proc is not None:
raise CMakeException('The CMake server was already started')
- for_machine = MachineChoice.HOST # TODO make parameter
- cmake_exe = CMakeExecutor(self.env, '>=3.7', for_machine)
- if not cmake_exe.found():
- raise CMakeException('Unable to find CMake')
+ assert cmake_exe.found()
mlog.debug('Starting CMake server with CMake', mlog.bold(' '.join(cmake_exe.get_command())), 'version', mlog.cyan(cmake_exe.version()))
self.proc = Popen(cmake_exe.get_command() + ['-E', 'server', '--experimental', '--debug'], stdin=PIPE, stdout=PIPE)