Skip to content

Commit 688a94d

Browse files
authored
Merge pull request #6765 from erg/ninja-env-cxx-fix
utils/.../ninja.py: Support CXX for ninja builds on Linux.
2 parents 2fab44a + 1f0baff commit 688a94d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

utils/swift_build_support/swift_build_support/products/ninja.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ def do_build(self):
4747
"-mmacosx-version-min={osx_version}"
4848
).format(osx_version=osx_version_min),
4949
}
50+
elif self.toolchain.cxx:
51+
env = {
52+
"CXX": self.toolchain.cxx,
53+
}
5054

5155
# Ninja can only be built in-tree. Copy the source tree to the build
5256
# directory.

utils/swift_build_support/tests/products/test_ninja.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ def test_do_build(self):
9999
cxx=self.toolchain.cxx,
100100
sysroot=xcrun.sdk_path('macosx')
101101
)
102+
elif self.toolchain.cxx:
103+
expect_env = (
104+
"env "
105+
"CXX={cxx} "
106+
).format(
107+
cxx=self.toolchain.cxx,
108+
)
102109

103110
self.assertEqual(self.stdout.getvalue(), """\
104111
+ rm -rf {build_dir}

0 commit comments

Comments
 (0)