Created
February 15, 2023 16:23
-
-
Save exoosh/41b868ad169bce7ba5483fa508be4034 to your computer and use it in GitHub Desktop.
Detecting most recent Clang tools (GNU make)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Small function to use Bash to detect the latest available clang and clang++ binaries, if using them by that name fails | |
detect_newest=$(shell bash -c 'for v in "" -{32..1}; do test -n "$$(which -- $1$$v)" && { echo "$1$$v"; break; }; done') | |
override CXX:=$(call detect_newest,clang++) | |
override CC:=$(call detect_newest,clang) | |
$(warning CC: $(CC)) | |
$(warning CXX: $(CXX)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment