summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeyun Jung <jy1210.jung@samsung.com>2024-11-06 11:24:09 +0900
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>2024-11-07 17:48:40 +0900
commite3836f8fda1bc2db40b00d1fec1de043b044951b (patch)
treed27dfbb3250fe8c851543231c76fd32a6ed465d1
parentf5b00af7f5102b5412bbe3489b7f8b91e5079df8 (diff)
downloadmachine-learning-e3836f8fda1bc2db40b00d1fec1de043b044951b.tar.gz
machine-learning-e3836f8fda1bc2db40b00d1fec1de043b044951b.tar.bz2
machine-learning-e3836f8fda1bc2db40b00d1fec1de043b044951b.zip
[Meson] warning flags
Code clean, check supported args and set warning flags. Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
-rw-r--r--java/android/nnstreamer/src/main/jni/nnstreamer-native-api.c11
-rw-r--r--meson.build36
2 files changed, 25 insertions, 22 deletions
diff --git a/java/android/nnstreamer/src/main/jni/nnstreamer-native-api.c b/java/android/nnstreamer/src/main/jni/nnstreamer-native-api.c
index 1580dbd..15498ed 100644
--- a/java/android/nnstreamer/src/main/jni/nnstreamer-native-api.c
+++ b/java/android/nnstreamer/src/main/jni/nnstreamer-native-api.c
@@ -168,22 +168,17 @@ extern void init_filter_mxnet (void);
extern void init_filter_llama2c (void);
#endif
-
-#if defined GST_VERSION_MINOR && GST_VERSION_MINOR >= 24
+#if GST_CHECK_VERSION(1, 24, 0)
/**
* @brief External function from GStreamer Android. (Dummy function)
*/
-static void gst_android_init (JNIEnv * env, jobject context) {
- do {
-
- } while(0);
-}
+#define gst_android_init(...)
#else
/**
* @brief External function from GStreamer Android.
*/
extern void gst_android_init (JNIEnv * env, jobject context);
-#endif /* GST_VERSION_MINOR >= 24 */
+#endif
#endif /* __ANDROID__ */
/**
diff --git a/meson.build b/meson.build
index 739e137..4db269d 100644
--- a/meson.build
+++ b/meson.build
@@ -60,6 +60,22 @@ add_project_arguments('-DVERSION_MICRO=' + api_version_split[2], language: ['c',
# Define warning flags for c and cpp
warning_flags = [
+ '-Werror=address',
+ '-Werror=array-bounds',
+ '-Werror=empty-body',
+ '-Werror=format=2',
+ '-Werror=init-self',
+ '-Werror=int-to-pointer-cast',
+ '-Werror=main',
+ '-Werror=missing-braces',
+ '-Werror=nonnull',
+ '-Werror=return-type',
+ '-Werror=sequence-point',
+ '-Werror=trigraphs',
+ '-Werror=write-strings',
+ '-Wredundant-decls',
+ '-Wmissing-braces',
+ '-Wmaybe-uninitialized',
'-Wwrite-strings',
'-Wformat',
'-Wformat-nonliteral',
@@ -72,6 +88,9 @@ warning_flags = [
]
warning_c_flags = [
+ '-Werror=implicit',
+ '-Werror=pointer-to-int-cast',
+ '-Werror=undef',
'-Wmissing-declarations',
'-Wmissing-include-dirs',
'-Wmissing-prototypes',
@@ -82,20 +101,9 @@ warning_c_flags = [
]
# Setup warning flags for c and cpp
-foreach extra_arg : warning_flags
- if cc.has_argument (extra_arg)
- add_project_arguments([extra_arg], language: 'c')
- endif
- if cxx.has_argument (extra_arg)
- add_project_arguments([extra_arg], language: 'cpp')
- endif
-endforeach
-
-foreach extra_arg : warning_c_flags
- if cc.has_argument (extra_arg)
- add_project_arguments([extra_arg], language: 'c')
- endif
-endforeach
+add_project_arguments(cc.get_supported_arguments(warning_c_flags), language: 'c')
+add_project_arguments(cc.get_supported_arguments(warning_flags), language: 'c')
+add_project_arguments(cxx.get_supported_arguments(warning_flags), language: 'cpp')
# Set project args
if get_option('enable-tizen')