File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,9 +18,16 @@ cxx_type=$($CXX --version | head -1 | cut -d' ' -f1)
1818if [ " $cxx_type " = " Ubuntu" ]; then
1919 cxx_type=$( $CXX --version | head -1 | cut -d' ' -f2)
2020fi
21+ # TODO: how to get built-in include paths from compiler?
2122if [ " $cxx_type " = " g++" ]; then
2223 gcc_ver=$( $CXX -dumpversion)
23- ./simplecpp simplecpp.cpp -e -f -std=gnu++11 -D__GNUC__ -D__STDC__ -D__STDC_HOSTED__ -D__CHAR_BIT__=8 -I" /usr/include" -I" /usr/include/linux" -I" /usr/include/c++/$gcc_ver " -I" /usr/include/x86_64-linux-gnu/c++/$gcc_ver "
24+ # some required include paths might differ per distro
25+ extra_inc=
26+ if [ -d " /usr/include/x86_64-linux-gnu" ]; then
27+ extra_inc=" $extra_inc -I/usr/include/x86_64-linux-gnu/c++/$gcc_ver "
28+ extra_inc=" $extra_inc -I/usr/include/x86_64-linux-gnu/c++/$gcc_ver "
29+ fi
30+ ./simplecpp simplecpp.cpp -e -f -std=gnu++11 -D__GNUC__ -D__STDC__ -D__STDC_HOSTED__ -D__CHAR_BIT__=8 -D" __has_builtin(x)=(1)" -D" __has_cpp_attribute(x)=(0)" -D" __has_attribute(x)=(0)" -I" /usr/include" -I" /usr/include/linux" -I" /usr/include/c++/$gcc_ver " -I" /usr/include/c++/$gcc_ver /x86_64-pc-linux-gnu" -I" /usr/lib/gcc/x86_64-pc-linux-gnu/$gcc_ver /include" $extra_inc
2431 ec=$?
2532 if [ $ec -ne 0 ]; then
2633 exit $ec
You can’t perform that action at this time.
0 commit comments