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

build.sh: On Linux force use of latest Clang #8522

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dneto0
Copy link

@dneto0 dneto0 commented Mar 13, 2025

CMake will default to GCC if it's available.
Force use of the latest Clang instead.
This can be overridden with CC, CXX, and CXXFLAGS

Fixed: #8515

@dneto0 dneto0 marked this pull request as draft March 13, 2025 21:18
CMake will default to GCC if it's available.
Force use of the oldest installed Clang instead.
This can be overridden with CC, CXX, and CXXFLAGS

Fixed: google#8515
@@ -224,6 +224,17 @@ BUILD_CUSTOM_TARGETS=
UNAME=$(uname)
LC_UNAME=$(echo "${UNAME}" | tr '[:upper:]' '[:lower:]')

if [[ "$LC_UNAME" == "linux" ]]; then
# On Linux both GCC and Clang are commonly available, but CMake
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe exiting when clang is not available would be helpful as well. Otherwise, we'd get a cmake error that's less scrutable (?).

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, looks like this will break our github workflows since we're not using the latest clang version on system but a fixed one.

Copy link
Author

Choose a reason for hiding this comment

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

I'm still struggling to build anyway. E.g. the SDL2 build isn't picking up stdint.h typedefs, and I am not chasing everything down. So this is getting opportunistic for me.

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.

easy-build flow: on linux, if both GCC and Clang are installed, build fails because CMake picks GCC
2 participants