File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -143,20 +143,14 @@ jobs:
143143 run : |
144144 echo "Detecting STL version using $CXX"
145145
146- STL_VER_RAW =$($CXX -dM -E -x c++ - <<<'#include <vector>' 2>/dev/null | grep -E '__GLIBCXX__|_LIBCPP_VERSION' )
146+ STL_DEFINE =$($CXX -dM -E -x c++ - <<<'#include <vector>' 2>/dev/null | grep -E '^#define ( __GLIBCXX__|_LIBCPP_VERSION) ' || true )
147147
148- if echo "$STL_VER_RAW" | grep -q '__GLIBCXX__'; then
149- val=$(echo "$STL_VER_RAW" | grep '__GLIBCXX__' | awk '{print $3}')
150- major=${val:0:4}
151- minor=${val:4:2}
152- patch=${val:6:2}
153- STL_VERSION="libstdcxx${major}.${minor}.${patch}"
154- elif echo "$STL_VER_RAW" | grep -q '_LIBCPP_VERSION'; then
155- val=$(echo "$STL_VER_RAW" | grep '_LIBCPP_VERSION' | awk '{print $3}')
156- major=$((10#${val:0:2}))
157- minor=$((10#${val:2:2}))
158- patch=$((10#${val:4:2}))
159- STL_VERSION="libcxx${major}.${minor}.${patch}"
148+ if echo "$STL_DEFINE" | grep -q '__GLIBCXX__'; then
149+ val=$(echo "$STL_DEFINE" | grep '__GLIBCXX__' | awk '{print $3}')
150+ STL_VERSION="libstdcxx${val}"
151+ elif echo "$STL_DEFINE" | grep -q '_LIBCPP_VERSION'; then
152+ val=$(echo "$STL_DEFINE" | grep '_LIBCPP_VERSION' | awk '{print $3}')
153+ STL_VERSION="libcxx${val}"
160154 else
161155 STL_VERSION="unknown"
162156 fi
You can’t perform that action at this time.
0 commit comments