From d5c039d0c2f63b38d21f410fd863732188b74a08 Mon Sep 17 00:00:00 2001 From: Muhammad Omair Javaid Date: Tue, 24 Jun 2025 13:42:46 +0500 Subject: [PATCH 1/2] Automatically set Ninja generator for --use-make=ninja When using `--use-make=ninja` or `--use-make=ninja.exe`, the build would previously fail because CMake was not instructed to generate the corresponding Ninja build files. It would default to generating Makefiles for Linux or Visual Studio MSBuild files for Windows. This change detects when the specified make program is ninja and automatically adds the `-G Ninja` flag to the CMake config step. --- lnt/tests/test_suite.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lnt/tests/test_suite.py b/lnt/tests/test_suite.py index 97619742..a4841ae8 100644 --- a/lnt/tests/test_suite.py +++ b/lnt/tests/test_suite.py @@ -448,6 +448,11 @@ def _configure(self, path, extra_cmake_defs=[], execute=True): defs['CMAKE_CXX_COMPILER'] = self.opts.cxx if self.opts.make: defs['CMAKE_MAKE_PROGRAM'] = self.opts.make + if self.opts.make and (self.opts.make.endswith('ninja') or + self.opts.make.endswith('ninja.exe')): + cmake_flags = ['-G', 'Ninja'] + else: + cmake_flags = [] cmake_build_types = ('DEBUG', 'MINSIZEREL', 'RELEASE', 'RELWITHDEBINFO') From 1909e5afdd934ff95ffa0a84b964af0ef1ca23a5 Mon Sep 17 00:00:00 2001 From: Muhammad Omair Javaid Date: Tue, 24 Jun 2025 14:10:56 +0500 Subject: [PATCH 2/2] Fix missed change of cmake_flags --- lnt/tests/test_suite.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lnt/tests/test_suite.py b/lnt/tests/test_suite.py index a4841ae8..95be4cdf 100644 --- a/lnt/tests/test_suite.py +++ b/lnt/tests/test_suite.py @@ -525,7 +525,6 @@ def _configure(self, path, extra_cmake_defs=[], execute=True): self.remote_run = True # Prepare cmake cache if requested: - cmake_flags = [] for cache in self.opts.cmake_cache: if cache == "": continue