Change PB_RETURN_ERROR() macro to avoid compiler warnings.
[apps/agl-service-can-low-level.git] / tests / SConstruct
index 1890670..9c222da 100644 (file)
@@ -121,9 +121,6 @@ elif 'cl' in env['CC']:
     
     # More strict checks on the nanopb core
     env.Append(CORECFLAGS = '/W4')
-    
-    # PB_RETURN_ERROR triggers C4127 because of while(0)
-    env.Append(CFLAGS = '/wd4127')
 elif 'tcc' in env['CC']:
     # Tiny C Compiler
     env.Append(CFLAGS = '-Wall -Werror -g')
@@ -136,12 +133,18 @@ elif 'g++' in env['CXX'] or 'gcc' in env['CXX']:
     env.Append(CXXFLAGS = '-g -Wall -Werror -Wextra -Wno-missing-field-initializers')
 elif 'cl' in env['CXX']:
     env.Append(CXXFLAGS = '/Zi /W2 /WX')
-    
+
 # Now include the SConscript files from all subdirectories
 import os.path
 env['VARIANT_DIR'] = 'build'
 env['BUILD'] = '#' + env['VARIANT_DIR']
 env['COMMON'] = '#' + env['VARIANT_DIR'] + '/common'
+
+# Include common/SConscript first to make sure its exports are available
+# to other SConscripts.
+SConscript("common/SConscript", exports = 'env', variant_dir = env['VARIANT_DIR'] + '/common')
+
 for subdir in Glob('*/SConscript') + Glob('regression/*/SConscript'):
+    if str(subdir).startswith("common"): continue
     SConscript(subdir, exports = 'env', variant_dir = env['VARIANT_DIR'] + '/' + os.path.dirname(str(subdir)))