Git Product home page Git Product logo

Comments (3)

memsharded avatar memsharded commented on July 1, 2024

Hi @Todiq

I think this is intended behavior of the API. One api is to detect the full version of clang, in your case is 17.0.

Then, Conan default settings might not include certain versions. To map full compiler versions to the actual versions, there is another api called default_compiler_version, that can be used:

compiler.version={{detect_api.default_compiler_version(compiler, version)}}

This way the api gives power to users that want the full clang version, while allowing to also define the predefined settings.yml default versions with the default Conan compatibility.

Check https://docs.conan.io/2/reference/config_files/profiles.html for more details.

from conan.

Todiq avatar Todiq commented on July 1, 2024

Hello @memsharded,

Thanks for your answer. If the API's goal is to detect the full version, shouldn't it then also add the minor version? I am currently running clang 17.0.3, not 17.0.

compiler.version={{detect_api.default_compiler_version(compiler, version)}}

Thanks for the hint, but I cannot use that as is. In fact, when there are more than one compiler installed, I can't be sure of what the result would be. In my case, it returns msvc's version, which is 194.

I guess there would be a way in Jinja2's syntax to remove the .0 of 17.0?

from conan.

memsharded avatar memsharded commented on July 1, 2024

Thanks for the hint, but I cannot use that as is. In fact, when there are more than one compiler installed, I can't be sure of what the result would be. In my case, it returns msvc's version, which is 194.

But you can call it with default_compiler_version(clang, clang_version) from your code above:

{% set clang, clang_version, clang_exe = detect_api.detect_clang_compiler(compiler_exe="clang") %}
{% set clang_final_version = default_compiler_version(clang, clang_version) %}
...
myproj*/*:compiler.version = {{clang_final_version}}

Thanks for your answer. If the API's goal is to detect the full version, shouldn't it then also add the minor version? I am currently running clang 17.0.3, not 17.0.

To be accurate, Conan default settings define in some cases, as gcc, both major and major+minor versions:

"10", "10.1", "10.2", "10.3", "10.4", "10.5",
"11", "11.1", "11.2", "11.3", "11.4",

If users want to chose which one of the defaults they use, they can use the one with the minor, or the one returned by default_compiler_version. It is true that we haven't seen anyone so far that wanted to model down to the patch version of the compiler.

from conan.

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.