Skip to content

Commit fe8e9f9

Browse files
committed
zproject_autotools.gsl : basic clang support for default-Werror builds
1 parent fdc3d3d commit fe8e9f9

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

zproject_autotools.gsl

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,26 +1198,30 @@ AS_IF([test "x$enable_Werror" = "xyes" || test "x$enable_Werror" = "xauto"],
11981198
[AS_IF([test -n "$CC"],[AS_IF([$CC --version 2>&1 | grep 'Free Software Foundation' > /dev/null && test "x$GCC" = "xyes"],
11991199
[AC_MSG_NOTICE([Enabling pedantic errors for GNU C])
12001200
CFLAGS="$CFLAGS -pedantic -Wall -Werror -Werror=format-security"],
1201-
[AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU C)])
1202-
AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C: $CC])])
1203-
])])
1201+
[AS_IF([$CC --version 2>&1 | grep 'clang version' > /dev/null],
1202+
[AC_MSG_NOTICE([Enabling pedantic errors for clang C])
1203+
CFLAGS="$CFLAGS -pedantic -Wall -Werror -Werror=format-security"],
1204+
[AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU or clang C)])
1205+
AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C: $CC])])
1206+
])])])
12041207
AS_IF([test -n "$CXX"],[AS_IF([$CXX --version 2>&1 | grep 'Free Software Foundation' > /dev/null && test "x$GCC" = "xyes"],
12051208
[AC_MSG_NOTICE([Enabling pedantic errors for GNU C++])
12061209
CXXFLAGS="$CXXFLAGS -pedantic -Wall -Werror -Werror=format-security"],
1207-
[AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU C++)])
1208-
AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C++: $CXX])])
1209-
])])
1210+
[AS_IF([$CXX --version 2>&1 | grep 'clang version' > /dev/null],
1211+
[AC_MSG_NOTICE([Enabling pedantic errors for clang C++])
1212+
CXXFLAGS="$CXXFLAGS -pedantic -Wall -Werror -Werror=format-security"],
1213+
[AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU or clang C++)])
1214+
AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C++: $CXX])])
1215+
])])])
12101216
AS_IF([test -n "$CPP"],[AS_IF([$CPP --version 2>&1 | grep 'Free Software Foundation' > /dev/null && test "x$GCC" = "xyes"],
12111217
[AC_MSG_NOTICE([Enabling pedantic errors for GNU CPP preprocessor])
1212-
.if project.use_cxx
1213-
CPPFLAGS="$CPPFLAGS -pedantic -Werror -Wall"
1214-
.else
1215-
CPPFLAGS="$CPPFLAGS -pedantic -Werror -Wall -Wc++-compat"
1216-
.endif
1217-
],
1218-
[AC_MSG_NOTICE([Not enabling pedantic errors: preprocessor not supported by this recipe (not GNU CPP)])
1219-
AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for CPP: $CPP])])
1220-
])])
1218+
CPPFLAGS="$CPPFLAGS -pedantic -Werror -Wall -Wc++-compat"],
1219+
[AS_IF([$CXX --version 2>&1 | grep 'clang version' > /dev/null],
1220+
[AC_MSG_NOTICE([Enabling pedantic errors for clang CPP preprocessor])
1221+
CPPFLAGS="$CPPFLAGS -pedantic -Werror -Wall -Wc++-compat"],
1222+
[AC_MSG_NOTICE([Not enabling pedantic errors: preprocessor not supported by this recipe (not GNU or clang CPP)])
1223+
AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for CPP: $CPP])])
1224+
])])])
12211225
])
12221226

12231227
.if project.use_cxx_gcc_4_9

0 commit comments

Comments
 (0)