build: prevent unused-parameter warning
authorGeorge Nash <george.nash@intel.com>
Thu, 13 Jul 2017 19:44:40 +0000 (12:44 -0700)
committerRick Bell <richard.s.bell@intel.com>
Wed, 6 Sep 2017 23:53:23 +0000 (23:53 +0000)
the connectivity bt_le_adapter has auto generates files
  - bluez-glue.c
  - object_manager-glue.c

The files are included when building the connectivity_abstraction
library. This error is only disabled when bt_le_adapter is being
built. We don't want to hide the unused-parameter warning. This
is the simplest way to hide the warning without large changes
in the build.

Change-Id: Ieca1412ab744b7fccf408a80f66ef0add1a91fa6
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21429
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit e7ea0fdccf6187a19abfb3f7ac650d8852437d13)
Reviewed-on: https://gerrit.iotivity.org/gerrit/22217
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
resource/csdk/connectivity/src/SConscript

index 78d5efb..9801397 100644 (file)
@@ -150,6 +150,14 @@ if ca_os in ['linux', 'tizen', 'android', 'ios', 'windows'] and with_tcp:
 
 SConscript(dirs = list(transports), exports='connectivity_env')
 
+# prevent unused-parameter warning from bluez-glue.c and object_manager-glue.c
+# files when building bt_le_adapter. These files are generated by a tool and
+# should not be changed. We should not be hiding the unused-parameter but in
+# this limited case a exception is made.
+if ca_os in ['linux']:
+    if 'bt_le_adapter' in transports:
+        connectivity_env.AppendUnique(CCFLAGS=['-Wno-unused-parameter'])
+
 if ca_os == 'android':
     connectivity_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libca-interface.so'])
     connectivity_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libconnectivity_abstraction.so'])