Enable most warnings, and make them errors.

This adds `-Wall` and `-Werror` to the C and C++ compiler flags. It
also adds `-Wno-attributes` to disable warnings about unrecognized
attributes. This is needed because the `swift_name` test relies on
`__attribute__((swift_name(some_name)))` attribute.
This commit is contained in:
John VanEnk 2020-01-23 22:38:55 -08:00 committed by Emilio Cobos Álvarez
parent fb348d91e8
commit 70188bb3b2

View File

@ -72,6 +72,10 @@ fn compile(cbindgen_output: &Path, language: Language) {
command.arg("-D").arg("DEFINED");
command.arg("-c").arg(cbindgen_output);
command.arg("-o").arg(&object);
command.arg("-Wall");
command.arg("-Werror");
// `swift_name` is not recognzied by gcc.
command.arg("-Wno-attributes");
if let Language::Cxx = language {
// enum class is a c++11 extension which makes g++ on macos 10.14 error out
// inline variables are are a c++17 extension