Verified Commit 4a4c5a09 authored by Marc Vef's avatar Marc Vef
Browse files

Regex fix to determine compile based on $CXX env var

parent 386e50d0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -311,14 +311,14 @@ determine_compiler() {

    # We honor the CXX environment variable if defined.
    # Otherwise, we try to find the compiler by using `command -v`.
    if [[ -n "${CXX}" && ! "${CXX}" =~ ^(g\+\+|clang)$ ]]; then
    if [[ -n "${CXX}" && ! "${CXX}" =~ ^.*(g\+\+|clang)$ ]]; then
        echo "ERROR: Unknown compiler '${CXX}'"
        exit 1
    fi

    if [[ -n "${CXX}" && "${CXX}" =~ ^g\+\+$ ]]; then
    if [[ -n "${CXX}" && "${CXX}" =~ ^.*g\+\+$ ]]; then
        compiler_is_gnu
    elif [[ -n "${CXX}" && "$CXX" =~ ^clang$ ]]; then
    elif [[ -n "${CXX}" && "$CXX" =~ ^.*clang$ ]]; then
        compiler_is_clang
    elif [[ $(command -v g++) ]]; then
        compiler_is_gnu