Fix build order of iotivity_config.h
authorDavid Antler <david.a.antler@intel.com>
Mon, 26 Sep 2016 21:01:48 +0000 (14:01 -0700)
committerDave Thaler <dthaler@microsoft.com>
Fri, 30 Sep 2016 15:07:38 +0000 (15:07 +0000)
We should run the c_common SConscript to generate iotivity_config.h
before liblogger is built. This is because logger.c will include
"iotivity_config.h".

Change-Id: I6332e403a5ce457e682ff764b9d20899cf26aea3
Signed-off-by: David Antler <david.a.antler@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12231
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Soemin Tjong <stjong@microsoft.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
resource/SConscript
resource/c_common/SConscript
resource/c_common/windows/SConscript

index decd536..ab14110 100644 (file)
@@ -28,6 +28,9 @@ Import('env')
 target_os = env.get('TARGET_OS')
 src_dir = env.get('SRC_DIR')
 
+# Build C Common dependencies
+SConscript('c_common/SConscript')
+
 # Build liblogger
 SConscript('csdk/logger/SConscript')
 
@@ -37,9 +40,6 @@ if target_os not in ['arduino', 'darwin', 'ios', 'android', 'msys_nt', 'windows'
 # Download (if not already present) & build libcoap
 SConscript('#extlibs/libcoap/SConscript')
 
-# Build C Common dependencies
-SConscript('c_common/SConscript')
-
 # Build connectivity
 SConscript('csdk/connectivity/SConscript')
 
index 638b1cc..4d3cb55 100644 (file)
@@ -177,6 +177,8 @@ elif target_os  in ['windows']:
 else:
        common_src.append('octhread/src/noop/octhread.c')
 
+common_env.AppendUnique(LIBS = ['logger'])
+common_env.AppendUnique(CPPPATH = ['#resource/csdk/logger/include'])
 commonlib = common_env.StaticLibrary('c_common', common_src)
 common_env.InstallTarget(commonlib, 'c_common')
 common_env.UserInstallTargetLib(commonlib, 'c_common')
index 63ccb45..9bed509 100644 (file)
@@ -18,12 +18,16 @@ helper_src = [
        os.path.join(src_dir, 'pthread_create.c')
        ]
 
-static_libwinhelper = env.StaticLibrary('win_helper', helper_src)
-env.InstallTarget(static_libwinhelper, 'win_helper')
-env.UserInstallTargetLib(static_libwinhelper, 'win_helper')
-env.UserInstallTargetHeader('include/win_sleep.h', 'c_common/windows/include', 'win_sleep.h')
-env.UserInstallTargetHeader('include/pthread_create.h', 'c_common/windows/include', 'pthread_create.h')
-env.UserInstallTargetHeader('include/vs12_snprintf.h', 'c_common/windows/include', 'vs12_snprintf.h')
+win_helper_env = env.Clone()
+
+win_helper_env.AppendUnique(CPPPATH = ['#resource/csdk/logger/include'])
+static_libwinhelper = win_helper_env.StaticLibrary('win_helper', helper_src)
+
+win_helper_env.InstallTarget(static_libwinhelper, 'win_helper')
+win_helper_env.UserInstallTargetLib(static_libwinhelper, 'win_helper')
+win_helper_env.UserInstallTargetHeader('include/win_sleep.h', 'c_common/windows/include', 'win_sleep.h')
+win_helper_env.UserInstallTargetHeader('include/pthread_create.h', 'c_common/windows/include', 'pthread_create.h')
+win_helper_env.UserInstallTargetHeader('include/vs12_snprintf.h', 'c_common/windows/include', 'vs12_snprintf.h')
 
 env.AppendUnique(LIBS = ['win_helper'])