Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using cc executable to detect default compiler in Linux #16074

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Apr 12, 2024

Changelog: Fix: Use cc executable in Linux systems for autodetect compiler (conan profile detect and detect_api).
Docs: Omit

Close #8866

Note that this has some risk of breaking autodetection for users that define a weird, unrelated cc executable in their system

@jcar87
Copy link
Contributor

jcar87 commented Apr 12, 2024

I'd say this is more aligned with the current convention - if I'm not mistaken the cc command used to be specified by POSIX as the interface to the systems' C compiler. Now superseded by the c99 command, but cc is still assumed by longstanding convention.

However, almost all relevant tools (e.g. CMake and Autotools) will consider cc and c++ as the default compilers - this PR aligns better: it should still detect gcc on the vast majority of systems, and if cc or c++ point to something else, it will now be correct.

@memsharded memsharded marked this pull request as ready for review April 15, 2024 09:49
@memsharded memsharded added this to the 2.3.0 milestone Apr 15, 2024
@jcar87 jcar87 merged commit 06fdb13 into conan-io:develop2 Apr 16, 2024
2 checks passed
@memsharded memsharded deleted the fix/detect_use_cc branch April 16, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Integrate better with update-alternatives, cc, c++
4 participants