Giter Site home page Giter Site logo

Feature detection about clang-sys HOT 4 CLOSED

kylemayes avatar kylemayes commented on June 1, 2024
Feature detection

from clang-sys.

Comments (4)

KyleMayes avatar KyleMayes commented on June 1, 2024

No. There isn't a reliable way to parse clang --version as it differs from platform to platform, so I didn't even try.

However, now that I think about it, there may be a better way. You get linking errors if you attempt to call a clang 3.9 function but have linked to an earlier version of clang, so I might be able to detect the version of clang in use by attempting to compile a program using non-3.5 features in build.rs, I'll look into it soon.

from clang-sys.

Yamakaky avatar Yamakaky commented on June 1, 2024

I also think that would be more reliable (it compiles or not ^^).

from clang-sys.

KyleMayes avatar KyleMayes commented on June 1, 2024

I've actually gone an implemented this, but now that I've thought about it more I don't think it adds much. You will find out if your version of clang is insufficient when to attempt to use a function that your version of clang does not support by way of a link error. This would cause the failure to be one step earlier, but at the cost of added complexity and the risk of false positives.

from clang-sys.

Yamakaky avatar Yamakaky commented on June 1, 2024

That was mostly to add better error messages.

from clang-sys.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.