Last active
February 7, 2025 08:42
-
-
Save konsolebox/02bb53cda0789840362c721ca9ce5ec3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
inherit toolchain-funcs | |
tc-get-resource-dir() { | |
local compiler_type=$(tc-get-compiler-type) | |
case ${compiler_type} in | |
gcc) | |
$(tc-getCC) -print-search-dirs | \ | |
awk '/^install: / { print $2; r = 1 } END { exit !r }' || die | |
;; | |
clang) | |
$(tc-getCC) -print-resource-dir || die | |
;; | |
*) | |
die "Unsupported compiler type: ${compiler_type}" | |
;; | |
esac | |
} | |
tc-get-include-dir() { | |
local resource_dir | |
resource_dir=$(tc-get-resource-dir) && echo "${resource_dir%/}/include" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment