Update cflags for building Windows modules with Clang
Bug: http://b/69933068
- Add -Wexit-time-destructor globally after fixing one warning
- Enable -Wthread-safety only for non-windows targets. The version of
libstdc++ we use for Windows doesn't have the correct thread-safety
annotations.
Test: Run Clang-built adb_test.exe under wine
Change-Id: I76a43060342e7d1dc370ce3e117f3563c82b7751
diff --git a/adb/Android.bp b/adb/Android.bp
index 97c9762..c0e4c57 100644
--- a/adb/Android.bp
+++ b/adb/Android.bp
@@ -19,17 +19,13 @@
"-Wall",
"-Wextra",
"-Werror",
+ "-Wexit-time-destructors",
"-Wno-unused-parameter",
"-Wno-missing-field-initializers",
"-Wvla",
],
rtti: true,
- clang_cflags: [
- "-Wexit-time-destructors",
- "-Wthread-safety",
- ],
-
use_version_lib: true,
compile_multilib: "first",
@@ -85,6 +81,12 @@
"-luserenv",
],
},
+
+ not_windows: {
+ cflags: [
+ "-Wthread-safety",
+ ],
+ },
},
}