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

DM-12014: Use clang if no compiler was given and gcc is clang #39

Merged
merged 1 commit into from Sep 25, 2017

Conversation

timj
Copy link
Member

@timj timj commented Sep 25, 2017

Avoid confusion by using clang if this is really clang rather than using gcc.

Without this if you type scons you get gcc but it's really clang.

Avoid confusion by using clang if this is really clang rather than
using gcc.
@timj timj changed the title Use clang if no compiler was given and gcc is clang DM-12014: Use clang if no compiler was given and gcc is clang Sep 25, 2017
Copy link
Contributor

@PaulPrice PaulPrice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, but I'm not intimately familiar with this area of sconsUtils.

# If we have picked up a default compiler called gcc that is really
# clang, we call it clang to avoid confusion (gcc on macOS has subtly
# different options)
if not env['cc'] and env.whichCc == "clang" and env['CC'] == "gcc":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env['cc'] is empty, but env['CC'] is not.... Confusing! (Not your fault!)
Might env['CC'] be gcc with some extra version cruft, e.g., gcc-4.8.4?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env['cc'] is the external command line override for the compiler and env['CC'] is the compiler that we are actually using. If there is extra cruft in the gcc name then it's highly likely that this is not a clang -- if it is a clang then it makes no sense for it to be a gcc-n.

@timj timj merged commit 8d9cf34 into master Sep 25, 2017
@ktlim ktlim deleted the tickets/DM-12014 branch August 25, 2018 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants