[BUILD] fix supported gmock version
authorJiho Chu <jiho.chu@samsung.com>
Thu, 30 Jun 2022 02:25:21 +0000 (11:25 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Mon, 4 Jul 2022 05:09:03 +0000 (14:09 +0900)
google mock API is changed from 1.10.0,
and it does not support MOCK_METHOD under 1.10.0 version.
'profiler' test is only enabled for proper gmock.

MOCK_METHOD macro needs the upper verison(>=1.10) of gmock.

Signed-off-by: Jiho Chu <jiho.chu@samsung.com>
meson.build
test/unittest/meson.build

index 959dccd..f99a5a0 100644 (file)
@@ -262,7 +262,7 @@ if get_option('enable-tflite-interpreter')
   extra_defines += '-DENABLE_TFLITE_INTERPRETER=1'
 endif
 
-gmock_dep = dependency('gmock', static: true, required: false)
+gmock_dep = dependency('gmock', static: true, main: false, required: false)
 gtest_dep = dependency('gtest', static: true, main: false, required: false)
 gtest_main_dep = dependency('gtest', static: true, main: true, required: false)
 
index 26b9d8b..6ed994b 100644 (file)
@@ -51,7 +51,9 @@ test_target = [
 ]
 
 if get_option('enable-profile')
-  test_target += [['unittest_nntrainer_profiler', []]]
+  if gmock_dep.version().version_compare('>=1.10.0')
+    test_target += [['unittest_nntrainer_profiler', []]]
+  endif
 endif
 
 foreach target: test_target