|
178 | 178 |
|
179 | 179 | # Allow us to easily serialize Platform objects
|
180 | 180 | function Base.show(io::IO, p::Platform)
|
| 181 | + os(p) == "any" && return print(io, "any") |
181 | 182 | print(io, "Platform(")
|
182 | 183 | show(io, arch(p))
|
183 | 184 | print(io, ", ")
|
|
189 | 190 |
|
190 | 191 | # Make showing the platform a bit more palatable
|
191 | 192 | function Base.show(io::IO, ::MIME"text/plain", p::Platform)
|
| 193 | + os(p) == "any" && return print(io, "any") |
192 | 194 | str = string(platform_name(p), " ", arch(p))
|
193 | 195 | # Add on all the other tags not covered by os/arch:
|
194 | 196 | other_tags = sort!(filter!(kv -> kv[1] ∉ ("os", "arch"), collect(tags(p))))
|
@@ -548,26 +550,29 @@ function triplet(p::AbstractPlatform)
|
548 | 550 | end
|
549 | 551 |
|
550 | 552 | function os_str(p::AbstractPlatform)
|
551 |
| - if os(p) == "linux" |
| 553 | + _os = os(p) |
| 554 | + if _os == "linux" |
552 | 555 | return "-linux"
|
553 |
| - elseif os(p) == "macos" |
| 556 | + elseif _os == "macos" |
554 | 557 | osvn = os_version(p)
|
555 | 558 | if osvn !== nothing
|
556 | 559 | return "-apple-darwin$(osvn.major)"
|
557 | 560 | else
|
558 | 561 | return "-apple-darwin"
|
559 | 562 | end
|
560 |
| - elseif os(p) == "windows" |
| 563 | + elseif _os == "windows" |
561 | 564 | return "-w64-mingw32"
|
562 |
| - elseif os(p) == "freebsd" |
| 565 | + elseif _os == "freebsd" |
563 | 566 | osvn = os_version(p)
|
564 | 567 | if osvn !== nothing
|
565 | 568 | return "-unknown-freebsd$(osvn.major).$(osvn.minor)"
|
566 | 569 | else
|
567 | 570 | return "-unknown-freebsd"
|
568 | 571 | end
|
569 |
| - elseif os(p) == "openbsd" |
| 572 | + elseif _os == "openbsd" |
570 | 573 | return "-unknown-openbsd"
|
| 574 | + elseif _os == "any" |
| 575 | + return "" |
571 | 576 | else
|
572 | 577 | return "-unknown"
|
573 | 578 | end
|
|
0 commit comments