Skip to content

clang version detection #10

@devernay

Description

@devernay

sconsPorject always detects clang as being version 4.2.1, because the -dumpversion command-line option is actually a GCC compatibility option, and it always returns "4.2.1".
The actual clang version may be optained using the "-v" option, port example on Snow Leopard with macports clang 3.3 installed:
$ clang -v
clang version 3.3 (tags/RELEASE_33/final)
Target: i386-apple-darwin10.8.0
Thread model: posix

$ /usr/bin/clang -v
Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)
Target: i386-apple-darwin10
Thread model: posix

And on Leopard:
$ clang-mp-3.1 -v
clang version 3.1 (branches/release_31)
Target: powerpc-apple-darwin9.8.0
Thread model: posix
$ clang-mp-3.2 -v
clang version 3.2 (tags/RELEASE_32/final)
Target: powerpc-apple-darwin9.8.0
Thread model: posix
$ clang-mp-3.3 -v
clang version 3.3 (tags/RELEASE_33/final)
Target: powerpc-apple-darwin9.8.0
Thread model: posix

I guess compiler/clang.py could easily be modified to detect the actual clang version, which could be "the word before clang if it exists plus the number after version": 3.1, 3.2, 3.3, Apple-1.7 ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions