Windows: Change UWP_APP variable to match SCons
authorIbrahim Esmat <iesmat@microsoft.com>
Fri, 28 Jul 2017 00:54:45 +0000 (17:54 -0700)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Fri, 11 Aug 2017 16:53:39 +0000 (16:53 +0000)
We recently added our changes to the SCons repository
to allow us to build UWP Store compatible DLLs from SCons.
Rename the UWP_APP variable to be MSVC_UWP_APP to match
what is used in the SCons repository for building UWP DLLs.

Change-Id: I944afd0077c8690e49f8c03b2edd988c9d77b636
Signed-off-by: Ibrahim Esmat <iesmat@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21671
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
build_common/SConscript
build_common/windows/SConscript
extlibs/libcoap/SConscript
extlibs/sqlite3/SConscript
resource/IPCA/samples/SConscript
resource/csdk/stack/SConscript
resource/examples/SConscript
resource/unit_tests.scons
run.bat
tools/scons/RunTest.py

index 107974b..bd0edd1 100755 (executable)
@@ -261,7 +261,7 @@ if target_os == 'windows':
                      allowed_values=('12.0', '14.0')))
                      #TODO allowed_values=('12.0', '14.0', '15.0')))
     help_vars.Add(
-        EnumVariable('UWP_APP',
+        EnumVariable('MSVC_UWP_APP',
                      'Build a Universal Windows Platform (UWP) Application',
                      default='0',
                      allowed_values=('0', '1')))
@@ -429,7 +429,7 @@ def __set_dir(env, dir):
     build_dir = dir + '/out/' + target_os + '/'
 
     if target_os == 'windows':
-        if env.get('UWP_APP') == '1':
+        if env.get('MSVC_UWP_APP') == '1':
             build_dir = build_dir + 'uwp/'
         else:
             build_dir = build_dir + 'win32/'
index cf47d97..015d145 100644 (file)
@@ -131,7 +131,7 @@ if env.get('BUILD_JAVA') == True:
 help_vars.Update(env)
 Help(help_vars.GenerateHelpText(env))
 
-if env.get('UWP_APP') == '1':
+if env.get('MSVC_UWP_APP') == '1':
     # Create an MSBuilder that uses a generator to generate the MSBuild actions
     MSBuilder = Builder(generator = MSBuildGenerator)
     # Add the builder to the env
@@ -149,7 +149,7 @@ if env.get('UWP_APP') == '1':
 
 # Set common flags
 if env['CC'] == 'cl':
-    if env.get('UWP_APP') == '1':
+    if env.get('MSVC_UWP_APP') == '1':
         # Currently only supports VS2015 (14.0)
         # TODO add VS2017 (15.0)
         supported_uwp_msvc_versions = ['14.0']
@@ -224,7 +224,7 @@ if env['CC'] == 'cl':
     # See https://msdn.microsoft.com/en-us/library/ttcz0bys.aspx for more details.
     env.AppendUnique(CPPDEFINES=['_CRT_SECURE_NO_WARNINGS', '_CRT_NONSTDC_NO_WARNINGS', '_SCL_SECURE_NO_WARNINGS'])
 
-    if env.get('UWP_APP') != '1':
+    if env.get('MSVC_UWP_APP') != '1':
         # Add Desktop specific libraries
         env.AppendUnique(LIBS=[
             'bcrypt',
index 1a57d25..6999320 100644 (file)
@@ -210,7 +210,7 @@ if with_upstream_libcoap == '1':
 
         config_h_body = ''
 
-        if ((target_os == 'windows') and (libcoap_env.get('UWP_APP') == '1')):
+        if ((target_os == 'windows') and (libcoap_env.get('MSVC_UWP_APP') == '1')):
             # Workaround for libcoap config [Investigation in IOT-2234]:
             # libcoap builds its config file by trying to create a small program to see if an API is
             # available. However, when building with store libraries on windows, it doesn't seem
index c5e9666..6f6a14d 100644 (file)
@@ -40,7 +40,7 @@ if target_os in targets_need_sqlite:
         shutil.rmtree(sqlite_tmp_dir)
 
 if target_os in ['windows']:
-    if sqlite_env.get('UWP_APP') == '1':
+    if sqlite_env.get('MSVC_UWP_APP') == '1':
         sqlite_env.AppendUnique(CPPDEFINES=['SQLITE_OS_WINRT'])
     libsqlite3 = sqlite_env.StaticLibrary('sqlite3', sqlite_c)
     # In multi-threaded builds, SCons appears to proceed to using sqlite3.lib
index 7ec909a..c3f7bca 100644 (file)
@@ -28,5 +28,5 @@ Import('ipca_env')
 SConscript('ipcaapp/SConscript', 'ipca_env')
 SConscript('ElevatorServer/SConscript', 'ipca_env')
 SConscript('ElevatorClient/SConscript', 'ipca_env')
-if ipca_env.get('UWP_APP') == '1':
+if ipca_env.get('MSVC_UWP_APP') == '1':
     SConscript('ElevatorClientUWP/SConscript', 'ipca_env')
index ff706ed..70ffb07 100644 (file)
@@ -253,7 +253,7 @@ if 'SERVER' in rd_mode:
     if target_os not in ['linux', 'tizen', 'windows']:
         liboctbstack_src.append('#extlibs/sqlite3/sqlite3.c')
 
-if ((target_os in ['windows']) and (liboctbstack_env.get('UWP_APP') == '1')):
+if ((target_os in ['windows']) and (liboctbstack_env.get('MSVC_UWP_APP') == '1')):
     liboctbstack_src.append(OCTBSTACK_SRC + 'ocsqlite3helper.c')
 
 internal_liboctbstack = liboctbstack_env.StaticLibrary(
index ddf80f2..3441feb 100644 (file)
@@ -130,7 +130,7 @@ if target_os in ['msys_nt', 'windows']:
     examples += [winUIClient]
     # mediaserver uses GetVersionEx which is a windows native/desktop only API.
     # Only build for Native/Win32
-    if env.get('UWP_APP') != '1':
+    if env.get('MSVC_UWP_APP') != '1':
         mediaserver = examples_env.Program('mediaserver', 'mediaserver.cpp')
         examples += [mediaserver]
 
index 0d4c3df..e2e22de 100644 (file)
@@ -32,7 +32,7 @@ build_tests = False
 if target_os in ['windows']:
     # gtest has a lot of windows native/desktop only APIs. As all unit tests depend on gtest,
     # only enable unit tests if building for Win32.
-    if env.get('UWP_APP') != '1':
+    if env.get('MSVC_UWP_APP') != '1':
         build_tests = True
 elif target_os in ['darwin', 'linux', 'msys_nt']:
     build_tests = True
diff --git a/run.bat b/run.bat
index d7205db..19cfa18 100644 (file)
--- a/run.bat
+++ b/run.bat
@@ -55,9 +55,9 @@ if "%MULTIPLE_OWNER%" == "" (
   set MULTIPLE_OWNER=1
 )
 
-if "%UWP_APP%" == "" (
+if "%MSVC_UWP_APP%" == "" (
   REM Set it to build Win32 app by default
-  set UWP_APP=0
+  set MSVC_UWP_APP=0
 )
 
 if "%BUILD_JAVA%" == "" (
@@ -116,7 +116,7 @@ IF NOT "%1"=="" (
     set AUTOMATIC_UPDATE=1
   )
   IF /I "%1"=="-uwp" (
-    set UWP_APP=1
+    set MSVC_UWP_APP=1
   )
   IF /I "%1"=="-java" (
     set BUILD_JAVA=1
@@ -131,7 +131,7 @@ IF %RELEASE% == 1 (
 )
 
 set BUILD_VARIANT=win32
-if "%UWP_APP%" == "1" (
+if "%MSVC_UWP_APP%" == "1" (
   set BUILD_VARIANT=uwp
 )
 
@@ -144,7 +144,7 @@ IF "%BUILD_MSYS%" == "" (
   set PATH=!PATH!;!BUILD_DIR!;C:\msys64\mingw64\bin
 )
 
-set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% UWP_APP=%UWP_APP% RELEASE=%RELEASE% WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=%WITH_TCP% BUILD_SAMPLE=ON LOGGING=%LOGGING% LOG_LEVEL=%LOG_LEVEL% RD_MODE=%RD_MODE% ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP% MULTIPLE_OWNER=%MULTIPLE_OWNER% AUTOMATIC_UPDATE=%AUTOMATIC_UPDATE% BUILD_JAVA=%BUILD_JAVA%
+set BUILD_OPTIONS= TARGET_OS=%TARGET_OS% TARGET_ARCH=%TARGET_ARCH% MSVC_UWP_APP=%MSVC_UWP_APP% RELEASE=%RELEASE% WITH_RA=0 TARGET_TRANSPORT=IP SECURED=%SECURED% WITH_TCP=%WITH_TCP% BUILD_SAMPLE=ON LOGGING=%LOGGING% LOG_LEVEL=%LOG_LEVEL% RD_MODE=%RD_MODE% ROUTING=%ROUTING% WITH_UPSTREAM_LIBCOAP=%WITH_UPSTREAM_LIBCOAP% MULTIPLE_OWNER=%MULTIPLE_OWNER% AUTOMATIC_UPDATE=%AUTOMATIC_UPDATE% BUILD_JAVA=%BUILD_JAVA%
 
 REM Use MSVC_VERSION=12.0 for VS2013, or MSVC_VERSION=14.0 for VS2015.
 REM If MSVC_VERSION has not been defined here, SCons chooses automatically a VS version.
@@ -202,7 +202,7 @@ if "!RUN_ARG!"=="server" (
   echo Starting IoTivity build with these options:
   echo   TARGET_OS=%TARGET_OS%
   echo   TARGET_ARCH=%TARGET_ARCH%
-  echo   UWP_APP=%UWP_APP%
+  echo   MSVC_UWP_APP=%MSVC_UWP_APP%
   echo   BUILD_DIR=%BUILD_DIR%
   echo   SECURED=%SECURED%
   echo   RELEASE=%RELEASE%
index 6a0c659..02d14ed 100644 (file)
@@ -72,7 +72,7 @@ def run_test(env, xml_file, test, test_targets = ['test']):
     env.AlwaysBuild(ut)
 
 def run_uwp_wack_test(env, cert_file, appx_file, report_output_path):
-    if env.get('TARGET_OS') != 'windows' or env.get('UWP_APP') != '1':
+    if env.get('TARGET_OS') != 'windows' or env.get('MSVC_UWP_APP') != '1':
         return
 
     import winreg