Skip to content

Commit 719b112

Browse files
committed
[build-script] Add is_verbose support to cmake_product.
1 parent ae6714f commit 719b112

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

utils/swift_build_support/swift_build_support/products/cmake_product.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919

2020
class CMakeProduct(product.Product):
21+
def is_verbose(self):
22+
return self.args.verbose_build
23+
2124
def build_with_cmake(self, build_targets, build_type, build_args,
2225
prefer_just_built_toolchain=False):
2326
assert self.toolchain.cmake is not None
@@ -29,6 +32,12 @@ def build_with_cmake(self, build_targets, build_type, build_args,
2932
cmake_build.append(self.toolchain.distcc_pump)
3033
cmake_build.extend([self.toolchain.cmake, "--build"])
3134

35+
# If we are verbose...
36+
if self.is_verbose():
37+
# And ninja, add a -v.
38+
if self.args.cmake_generator == "Ninja":
39+
build_args.append('-v')
40+
3241
generator_output_path = ""
3342
if self.args.cmake_generator == "Ninja":
3443
generator_output_path = os.path.join(self.build_dir, "build.ninja")
@@ -82,6 +91,13 @@ def test_with_cmake(self, executable_target, results_targets,
8291

8392
if self.toolchain.distcc_pump:
8493
cmake_build.append(self.toolchain.distcc_pump)
94+
95+
# If we are verbose...
96+
if self.is_verbose():
97+
# And ninja, add a -v.
98+
if self.args.cmake_generator == "Ninja":
99+
build_args.append('-v')
100+
85101
cmake_args = [self.toolchain.cmake, "--build", self.build_dir,
86102
"--config", build_type, "--"]
87103
cmake_build.extend(cmake_args + build_args)

0 commit comments

Comments
 (0)