Skip to content

Commit

Permalink
pkgs/build-support: cc-wrapper.sh not detecting c++ files by extension (
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst authored Dec 31, 2024
2 parents d1a5190 + 8e3b8e0 commit af2c263
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkgs/build-support/cc-wrapper/cc-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ while (( "$n" < "$nParams" )); do
c++*) isCxx=1 ;;
esac
;;
# check common c++ file extensions
# taken from clang: https://github.com/llvm/llvm-project/blob/4d6a5fc702e568b0456c4d8f9e2307eb6d81e955/clang/lib/Driver/Types.cpp#L299-L369
*.C|*.H|*.cc|*.CC|*.cp|*.hh|*.ccm|*.cpp|*.CPP|*.c++|*.C++|*.cxx|*.CXX|*.hpp|*.hxx|*.c++m|*.cppm|*.cxxm) isCxx=1 ;;
--) # Everything else is positional args!
# See: https://github.com/llvm/llvm-project/commit/ed1d07282cc9d8e4c25d585e03e5c8a1b6f63a74

Expand All @@ -65,6 +68,12 @@ while (( "$n" < "$nParams" )); do

positionalArgs=("${params[@]:$n}")
params=("${params[@]:0:$((n - 1))}")

for pa in "${positionalArgs[@]}"; do
case $pa in
*.C|*.H|*.cc|*.CC|*.cp|*.hh|*.ccm|*.cpp|*.CPP|*.c++|*.C++|*.cxx|*.CXX|*.hpp|*.hxx|*.c++m|*.cppm|*.cxxm) isCxx=1 ;;
esac
done
break;
;;
-?*) ;;
Expand Down

0 comments on commit af2c263

Please sign in to comment.