build: Replace SCons.Error with exit message
authorGeorge Nash <george.nash@intel.com>
Tue, 20 Jun 2017 21:39:07 +0000 (14:39 -0700)
committerPhil Coval <philippe.coval@osg.samsung.com>
Tue, 4 Jul 2017 07:44:37 +0000 (07:44 +0000)
The build would crash if JAVA_HOME was not specified
because SCons.Error was not imported into the script.
This replaces the error with an exit message.

Change-Id: Ic950ae3dc0d0c3308d7bbd90ab965b17f4563f0f
Signed-off-by: George Nash <george.nash@intel.com>
Bug: https://jira.iotivity.org/browse/IOT-1745
Reviewed-on: https://gerrit.iotivity.org/gerrit/20947
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
(cherry picked from commit 369d43b707cabcf715f50ff4827670196c4f425f)
Reviewed-on: https://gerrit.iotivity.org/gerrit/21159
Reviewed-by: Mats Wichmann <mats@linux.com>
build_common/external_libs.scons

index 659f844..f9e61d5 100644 (file)
@@ -35,8 +35,8 @@ if env.get('BUILD_JAVA') == True and target_os != 'android':
             env.get('JAVA_HOME') + '/include/' + target_os
         ])
     else:
-        raise SCons.Errors.StopError(
-            'BUILD_JAVA is specified, but JAVA_HOME is not set.')
+        msg = "Error: BUILD_JAVA requires JAVA_HOME to be set for target '%s'" % target_os
+        Exit(msg)
 
 # External library include files are in <src_dir>/deps/<target_os>/include
 # the library binaries are in <src_dir>/deps/<target_os>/lib/<arch>