| 266 | set all_llvm_variants {llvm38 llvm39 llvmdev} |
| 267 | if {${os.major} < 10} { |
| 268 | lappend all_llvm_variants llvm33 |
| 269 | } |
| 270 | if {${os.major} < 11} { |
| 271 | lappend all_llvm_variants llvm34 |
| 272 | } |
| 273 | array set llvm_variant_version {llvm33 3.3 llvm34 3.4 llvm38 3.8 llvm39 3.9 llvmdev devel} |
| 274 | set llvm_version {} |
| 275 | |
| 276 | foreach variantname $all_llvm_variants { |
| 277 | set this_llvm_version $llvm_variant_version($variantname) |
| 278 | variant $variantname conflicts [ldelete $all_llvm_variants $variantname] description "Use llvm-${this_llvm_version} for libLTO" " |
| 279 | set llvm_version $this_llvm_version |
| 280 | depends_lib-append port:llvm-${this_llvm_version} |
| 281 | " |
| 282 | } |
| 283 | |
| 284 | proc some_llvm_variant_set {} { |
| 285 | global all_llvm_variants |
| 286 | foreach variantname $all_llvm_variants { |
| 287 | if {[variant_isset $variantname]} { |
| 288 | return yes |
| 289 | } |
| 290 | } |
| 291 | return no |
| 292 | } |
| 293 | |
287 | | set llvm_version {} |
288 | | variant llvm33 conflicts llvm34 llvm38 llvm39 llvmdev description {Use llvm-3.3 for libLTO} { |
289 | | set llvm_version 3.3 |
290 | | depends_lib-append port:llvm-${llvm_version} |
291 | | |
292 | | if {${os.major} >= 10} { |
293 | | ui_error "The +llvm33 variant is not supported on Snow Leopard and later." |
294 | | error "Invalid variant selected" |
295 | | } |
296 | | } |
297 | | |
298 | | variant llvm34 conflicts llvm33 llvm38 llvm39 llvmdev description {Use llvm-3.4 for libLTO} { |
299 | | set llvm_version 3.4 |
300 | | depends_lib-append port:llvm-${llvm_version} |
301 | | |
302 | | if {${os.major} >= 11} { |
303 | | ui_error "The +llvm34 variant is not supported on Lion and later." |
304 | | error "Invalid variant selected" |
305 | | } |
306 | | } |
307 | | |
308 | | variant llvm38 conflicts llvm33 llvm34 llvm39 llvmdev description {Use llvm-3.8 for libLTO} { |
309 | | set llvm_version 3.8 |
310 | | depends_lib-append port:llvm-${llvm_version} |
311 | | } |
312 | | |
313 | | variant llvm39 conflicts llvm33 llvm34 llvm38 llvmdev description {Use llvm-3.9 for libLTO} { |
314 | | set llvm_version 3.9 |
315 | | depends_lib-append port:llvm-${llvm_version} |
316 | | } |
317 | | |
318 | | variant llvmdev conflicts llvm33 llvm34 llvm38 llvm39 description {Use llvm-devel for libLTO} { |
319 | | set llvm_version devel |
320 | | depends_lib-append port:llvm-${llvm_version} |
321 | | } |
322 | | |