Skip to content

Commit 4b5f8dd

Browse files
author
Jacob Mizraji
authored
Merge pull request #14374 from zisko/dont-forget-libtool
Start passing libtool path to CMake
2 parents 17441af + 68f9659 commit 4b5f8dd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

utils/swift_build_support/swift_build_support/cmake.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def common_options(self):
108108
else:
109109
define("CMAKE_C_COMPILER:PATH", toolchain.cc)
110110
define("CMAKE_CXX_COMPILER:PATH", toolchain.cxx)
111+
define("CMAKE_LIBTOOL:PATH", toolchain.libtool)
111112

112113
if args.cmake_generator == 'Xcode':
113114
define("CMAKE_CONFIGURATION_TYPES",

utils/swift_build_support/tests/test_cmake.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def default_args(self):
3030
"""
3131
return Namespace(host_cc="/path/to/clang",
3232
host_cxx="/path/to/clang++",
33+
host_libtool="/path/to/libtool",
3334
enable_asan=False,
3435
enable_ubsan=False,
3536
enable_tsan=False,
@@ -58,6 +59,7 @@ def cmake(self, args):
5859
toolchain = host_toolchain()
5960
toolchain.cc = args.host_cc
6061
toolchain.cxx = args.host_cxx
62+
toolchain.libtool = args.host_libtool
6163
if args.distcc:
6264
toolchain.distcc = self.mock_distcc_path()
6365
toolchain.ninja = self.which_ninja(args)
@@ -71,6 +73,7 @@ def test_common_options_defaults(self):
7173
["-G", "Ninja",
7274
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
7375
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
76+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
7477
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
7578

7679
def test_common_options_asan(self):
@@ -83,6 +86,7 @@ def test_common_options_asan(self):
8386
"-DLLVM_USE_SANITIZER=Address",
8487
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
8588
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
89+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
8690
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
8791

8892
def test_common_options_ubsan(self):
@@ -95,6 +99,7 @@ def test_common_options_ubsan(self):
9599
"-DLLVM_USE_SANITIZER=Undefined",
96100
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
97101
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
102+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
98103
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
99104

100105
def test_common_options_tsan(self):
@@ -107,6 +112,7 @@ def test_common_options_tsan(self):
107112
"-DLLVM_USE_SANITIZER=Thread",
108113
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
109114
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
115+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
110116
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
111117

112118
def test_common_options_asan_ubsan(self):
@@ -120,6 +126,7 @@ def test_common_options_asan_ubsan(self):
120126
"-DLLVM_USE_SANITIZER=Address;Undefined",
121127
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
122128
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
129+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
123130
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
124131

125132
def test_common_options_ubsan_tsan(self):
@@ -133,6 +140,7 @@ def test_common_options_ubsan_tsan(self):
133140
"-DLLVM_USE_SANITIZER=Undefined;Thread",
134141
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
135142
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
143+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
136144
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
137145

138146
def test_common_options_asan_ubsan_tsan(self):
@@ -147,6 +155,7 @@ def test_common_options_asan_ubsan_tsan(self):
147155
"-DLLVM_USE_SANITIZER=Address;Undefined;Thread",
148156
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
149157
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
158+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
150159
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
151160

152161
def test_common_options_lsan(self):
@@ -159,6 +168,7 @@ def test_common_options_lsan(self):
159168
"-DLLVM_USE_SANITIZER=Leaks",
160169
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
161170
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
171+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
162172
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
163173

164174
def test_common_options_export_compile_commands(self):
@@ -171,6 +181,7 @@ def test_common_options_export_compile_commands(self):
171181
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
172182
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
173183
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
184+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
174185
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
175186

176187
def test_common_options_distcc(self):
@@ -195,6 +206,7 @@ def test_common_options_xcode(self):
195206
["-G", "Xcode",
196207
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
197208
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
209+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
198210
"-DCMAKE_CONFIGURATION_TYPES=" +
199211
"Debug;Release;MinSizeRel;RelWithDebInfo"])
200212

@@ -209,6 +221,7 @@ def test_common_options_clang_compiler_version(self):
209221
["-G", "Ninja",
210222
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
211223
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
224+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
212225
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
213226

214227
def test_common_options_clang_user_visible_version(self):
@@ -222,6 +235,7 @@ def test_common_options_clang_user_visible_version(self):
222235
["-G", "Ninja",
223236
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
224237
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
238+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
225239
"-DLLVM_VERSION_MAJOR:STRING=9",
226240
"-DLLVM_VERSION_MINOR:STRING=0",
227241
"-DLLVM_VERSION_PATCH:STRING=0",
@@ -239,6 +253,7 @@ def test_common_options_build_ninja(self):
239253
["-G", "Ninja",
240254
"-DCMAKE_C_COMPILER:PATH=/path/to/clang",
241255
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++",
256+
"-DCMAKE_LIBTOOL:PATH=/path/to/libtool",
242257
"-DCMAKE_MAKE_PROGRAM=" + self.which_ninja(args)])
243258

244259
def test_common_options_full(self):

0 commit comments

Comments
 (0)