Fix build error with scons-4.4.0 version which is based on python3
[platform/upstream/iotivity.git] / build_common / linux / SConscript
index c4e9145..dbd881c 100644 (file)
@@ -1,10 +1,11 @@
+# -*- mode: python; python-indent-offset: 4; indent-tabs-mode: nil -*-
 ##
 # This script set linux specific flags (GNU GCC)
 #
 ##
 Import('env')
 
-print "Reading linux configuration script"
+print("Reading linux configuration script")
 
 # Set release/debug flags
 if env.get('RELEASE'):
@@ -13,8 +14,13 @@ if env.get('RELEASE'):
 else:
        env.AppendUnique(CCFLAGS = ['-g'])
 
+# Test Coverage Flags and Library (if RELEASE=0)
+if not env.get('RELEASE') and env.get('COVERAGE_CHECKS'):
+    env.AppendUnique(CCFLAGS=['--coverage', '-fPIC', '-O0'])
+    env.AppendUnique(LINKFLAGS=['--coverage'])
+
 if env.get('LOGGING'):
-       env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
+    env.AppendUnique(CPPDEFINES = ['TB_LOG'])
 
 env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__'])
 env.AppendUnique(CFLAGS = ['-std=gnu99'])