@@ -37,6 +37,7 @@ def default_args(self):
37
37
distcc = False ,
38
38
cmake_generator = "Ninja" ,
39
39
clang_compiler_version = None ,
40
+ clang_user_visible_version = None ,
40
41
build_jobs = 8 ,
41
42
build_args = [],
42
43
verbose_build = False ,
@@ -187,17 +188,33 @@ def test_common_options_xcode(self):
187
188
def test_common_options_clang_compiler_version (self ):
188
189
args = self .default_args ()
189
190
args .clang_compiler_version = CompilerVersion (
190
- string_representation = "3.8.0 " ,
191
- components = ("3 " , "8 " , "0 " , None ))
191
+ string_representation = "999.0.999 " ,
192
+ components = ("999 " , "0 " , "999 " , None ))
192
193
cmake = self .cmake (args )
193
194
self .assertEqual (
194
195
list (cmake .common_options ()),
195
196
["-G" , "Ninja" ,
196
197
"-DCMAKE_C_COMPILER:PATH=/path/to/clang" ,
197
198
"-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++" ,
198
- "-DLLVM_VERSION_MAJOR:STRING=3" ,
199
- "-DLLVM_VERSION_MINOR:STRING=8" ,
199
+ "-DCMAKE_MAKE_PROGRAM=" + self .which_ninja (args )])
200
+
201
+ def test_common_options_clang_user_visible_version (self ):
202
+ args = self .default_args ()
203
+ args .clang_user_visible_version = CompilerVersion (
204
+ string_representation = "9.0.0" ,
205
+ components = ("9" , "0" , "0" , None ))
206
+ cmake = self .cmake (args )
207
+ self .assertEqual (
208
+ list (cmake .common_options ()),
209
+ ["-G" , "Ninja" ,
210
+ "-DCMAKE_C_COMPILER:PATH=/path/to/clang" ,
211
+ "-DCMAKE_CXX_COMPILER:PATH=/path/to/clang++" ,
212
+ "-DLLVM_VERSION_MAJOR:STRING=9" ,
213
+ "-DLLVM_VERSION_MINOR:STRING=0" ,
200
214
"-DLLVM_VERSION_PATCH:STRING=0" ,
215
+ "-DCLANG_VERSION_MAJOR:STRING=9" ,
216
+ "-DCLANG_VERSION_MINOR:STRING=0" ,
217
+ "-DCLANG_VERSION_PATCH:STRING=0" ,
201
218
"-DCMAKE_MAKE_PROGRAM=" + self .which_ninja (args )])
202
219
203
220
def test_common_options_build_ninja (self ):
@@ -218,9 +235,12 @@ def test_common_options_full(self):
218
235
args .export_compile_commands = True
219
236
args .distcc = True
220
237
args .cmake_generator = 'Xcode'
238
+ args .clang_user_visible_version = CompilerVersion (
239
+ string_representation = "9.0.0" ,
240
+ components = ("9" , "0" , "0" , None ))
221
241
args .clang_compiler_version = CompilerVersion (
222
- string_representation = "3.8.0 " ,
223
- components = ("3 " , "8 " , "0 " , None ))
242
+ string_representation = "999.0.900 " ,
243
+ components = ("999 " , "0 " , "900 " , None ))
224
244
args .build_ninja = True
225
245
cmake = self .cmake (args )
226
246
self .assertEqual (
@@ -234,9 +254,12 @@ def test_common_options_full(self):
234
254
"-DCMAKE_CXX_COMPILER_ARG1=/path/to/clang++" ,
235
255
"-DCMAKE_CONFIGURATION_TYPES=" +
236
256
"Debug;Release;MinSizeRel;RelWithDebInfo" ,
237
- "-DLLVM_VERSION_MAJOR:STRING=3" ,
238
- "-DLLVM_VERSION_MINOR:STRING=8" ,
239
- "-DLLVM_VERSION_PATCH:STRING=0" ])
257
+ "-DLLVM_VERSION_MAJOR:STRING=9" ,
258
+ "-DLLVM_VERSION_MINOR:STRING=0" ,
259
+ "-DLLVM_VERSION_PATCH:STRING=0" ,
260
+ "-DCLANG_VERSION_MAJOR:STRING=9" ,
261
+ "-DCLANG_VERSION_MINOR:STRING=0" ,
262
+ "-DCLANG_VERSION_PATCH:STRING=0" ])
240
263
# NOTE: No "-DCMAKE_MAKE_PROGRAM=/path/to/built/ninja" because
241
264
# cmake_generator is 'Xcode'
242
265
0 commit comments