public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] *** Add VS2019 Support ***
@ 2019-09-11  6:08 Cheng, Ching JenX
  2019-09-11  6:08 ` [PATCH 1/2] Add VS2019 Toolchain def Cheng, Ching JenX
  2019-09-11  6:08 ` [PATCH 2/2] Add VS2019 Support on ToolSetup Batches Cheng, Ching JenX
  0 siblings, 2 replies; 7+ messages in thread
From: Cheng, Ching JenX @ 2019-09-11  6:08 UTC (permalink / raw)
  To: devel

*** BLURB HERE ***

Ching JenX Cheng (2):
  Add VS2019 Toolchain def
  Add VS2019 Support on ToolSetup Batches

 BaseTools/Conf/tools_def.template | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
 BaseTools/get_vsvars.bat          |  39 +++++++++++++++++++++++++++++++--------
 BaseTools/set_vsprefix_envs.bat   |  70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 BaseTools/toolsetup.bat           |  16 +++++++++++++---
 edksetup.bat                      |   6 ++++--
 5 files changed, 235 insertions(+), 30 deletions(-)

--
2.21.0.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] Add VS2019 Toolchain def
  2019-09-11  6:08 [PATCH 0/2] *** Add VS2019 Support *** Cheng, Ching JenX
@ 2019-09-11  6:08 ` Cheng, Ching JenX
  2019-09-11 15:43   ` [edk2-devel] " Pete Batard
  2019-09-11  6:08 ` [PATCH 2/2] Add VS2019 Support on ToolSetup Batches Cheng, Ching JenX
  1 sibling, 1 reply; 7+ messages in thread
From: Cheng, Ching JenX @ 2019-09-11  6:08 UTC (permalink / raw)
  To: devel; +Cc: Amy Chan, Bob Feng, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2182

In order to support VS2019,
the first thing need to do is add 2019 toolchain on tools_def.template

Change-Id: Id52abdc9762cf06bb9a38bbfd1153608c878d839
Cc: Amy Chan <amy.chan@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com>
---
 BaseTools/Conf/tools_def.template | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 122 insertions(+), 12 deletions(-)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index 8f0e6cb6c2..7585a3e5db 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -63,27 +63,35 @@ DEFINE VS2017_BIN_X64     = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x64
 DEFINE VS2017_BIN_ARM     = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm
 DEFINE VS2017_BIN_AARCH64 = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm64
 
-DEFINE WINSDK_BIN       = ENV(WINSDK_PREFIX)
-DEFINE WINSDKx86_BIN    = ENV(WINSDKx86_PREFIX)
+DEFINE VS2019_BIN         = ENV(VS2019_PREFIX)bin
+DEFINE VS2019_HOST        = x86
+DEFINE VS2019_BIN_HOST    = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\DEF(VS2019_HOST)
+DEFINE VS2019_BIN_IA32    = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\x86
+DEFINE VS2019_BIN_X64     = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\x64
+DEFINE VS2019_BIN_ARM     = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\arm
+DEFINE VS2019_BIN_AARCH64 = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\arm64
+
+DEFINE WINSDK_BIN           = ENV(WINSDK_PREFIX)
+DEFINE WINSDKx86_BIN        = ENV(WINSDKx86_PREFIX)
 
 # Microsoft Visual Studio 2010
-DEFINE WINSDK7_BIN       = ENV(WINSDK7_PREFIX)
-DEFINE WINSDK7x86_BIN    = ENV(WINSDK7x86_PREFIX)
+DEFINE WINSDK7_BIN          = ENV(WINSDK7_PREFIX)
+DEFINE WINSDK7x86_BIN       = ENV(WINSDK7x86_PREFIX)
 
 # Microsoft Visual Studio 2012 Update 1 (required for rc.exe that was not included in the initial release)
-DEFINE WINSDK71_BIN       = ENV(WINSDK71_PREFIX)
-DEFINE WINSDK71x86_BIN    = ENV(WINSDK71x86_PREFIX)
+DEFINE WINSDK71_BIN         = ENV(WINSDK71_PREFIX)
+DEFINE WINSDK71x86_BIN      = ENV(WINSDK71x86_PREFIX)
 
 # Microsoft Visual Studio 2013 Professional Edition
-DEFINE WINSDK8_BIN       = ENV(WINSDK8_PREFIX)x86\
-DEFINE WINSDK8x86_BIN    = ENV(WINSDK8x86_PREFIX)x64
+DEFINE WINSDK8_BIN          = ENV(WINSDK8_PREFIX)x86\
+DEFINE WINSDK8x86_BIN       = ENV(WINSDK8x86_PREFIX)x64
 
 # Microsoft Visual Studio 2015 Professional Edition
-DEFINE WINSDK81_BIN       = ENV(WINSDK81_PREFIX)x86\
-DEFINE WINSDK81x86_BIN    = ENV(WINSDK81x86_PREFIX)x64
+DEFINE WINSDK81_BIN         = ENV(WINSDK81_PREFIX)x86\
+DEFINE WINSDK81x86_BIN      = ENV(WINSDK81x86_PREFIX)x64
 
-# Microsoft Visual Studio 2017 Professional Edition
-DEFINE WINSDK10_BIN       = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
+# Microsoft Visual Studio 2017/2019 Professional Edition
+DEFINE WINSDK10_BIN         = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
 
 # These defines are needed for certain Microsoft Visual Studio tools that
 # are used by other toolchains.  An example is that ICC on Windows normally
@@ -218,6 +226,17 @@ DEFINE DTC_BIN                 = ENV(DTC_PREFIX)dtc
 #                        Note:
 #                             Building of XIP firmware images for ARM/ARM64 is not currently supported (only applications).
 #                             /FILEALIGN:4096 and other changes are needed for ARM firmware builds.
+#   VS2019      -win32-  Requires:
+#                             Microsoft Visual Studio 2019 version 16.2 or later
+#                        Optional:
+#                             Required to build EBC drivers:
+#                               Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
+#                             Required to build platforms or ACPI tables:
+#                               Intel(r) ACPI Compiler (iasl.exe) from
+#                               https://acpica.org/downloads
+#                        Note:
+#                             Building of XIP firmware images for ARM/ARM64 is not currently supported (only applications).
+#                             /FILEALIGN:4096 and other changes are needed for ARM firmware builds.
 #   GCC48       -Linux,Windows-  Requires:
 #                             GCC 4.8 targeting x86_64-linux-gnu, aarch64-linux-gnu, or arm-linux-gnueabi
 #                        Optional:
@@ -1691,6 +1710,97 @@ NOOPT_VS2017_AARCH64_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
 *_VS2017_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC
 *_VS2017_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
 
+####################################################################################
+#   VS2019       - Microsoft Visual Studio 2017 with Intel ASL
+#   ASL          - Intel ACPI Source Language Compiler (iasl.exe)
+####################################################################################
+#   VS2019           - Microsoft Visual Studio 2017 professional Edition with Intel ASL
+*_VS2019_*_*_FAMILY        = MSFT
+*_VS2019_*_*_DLL           = DEF(VS2019_BIN_HOST)
+
+*_VS2019_*_MAKE_PATH       = DEF(VS2019_BIN_HOST)\nmake.exe
+*_VS2019_*_MAKE_FLAG       = /nologo
+*_VS2019_*_RC_PATH         = DEF(WINSDK10_BIN)\rc.exe
+
+*_VS2019_*_MAKE_FLAGS      = /nologo
+*_VS2019_*_SLINK_FLAGS     = /NOLOGO /LTCG
+*_VS2019_*_APP_FLAGS       = /nologo /E /TC
+*_VS2019_*_PP_FLAGS        = /nologo /E /TC /FIAutoGen.h
+*_VS2019_*_VFRPP_FLAGS     = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
+*_VS2019_*_DLINK2_FLAGS    = /WHOLEARCHIVE
+*_VS2019_*_ASM16_PATH      = DEF(VS2019_BIN_IA32)\ml.exe
+
+##################
+# ASL definitions
+##################
+*_VS2019_*_ASL_PATH        = DEF(WIN_IASL_BIN)
+*_VS2019_*_ASL_FLAGS       = DEF(DEFAULT_WIN_ASL_FLAGS)
+*_VS2019_*_ASL_OUTFLAGS    = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
+*_VS2019_*_ASLCC_FLAGS     = DEF(MSFT_ASLCC_FLAGS)
+*_VS2019_*_ASLPP_FLAGS     = DEF(MSFT_ASLPP_FLAGS)
+*_VS2019_*_ASLDLINK_FLAGS  = DEF(MSFT_ASLDLINK_FLAGS)
+
+##################
+# IA32 definitions
+##################
+*_VS2019_IA32_CC_PATH      = DEF(VS2019_BIN_IA32)\cl.exe
+*_VS2019_IA32_VFRPP_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
+*_VS2019_IA32_ASLCC_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
+*_VS2019_IA32_ASLPP_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
+*_VS2019_IA32_SLINK_PATH   = DEF(VS2019_BIN_IA32)\lib.exe
+*_VS2019_IA32_DLINK_PATH   = DEF(VS2019_BIN_IA32)\link.exe
+*_VS2019_IA32_ASLDLINK_PATH= DEF(VS2019_BIN_IA32)\link.exe
+*_VS2019_IA32_APP_PATH     = DEF(VS2019_BIN_IA32)\cl.exe
+*_VS2019_IA32_PP_PATH      = DEF(VS2019_BIN_IA32)\cl.exe
+*_VS2019_IA32_ASM_PATH     = DEF(VS2019_BIN_IA32)\ml.exe
+
+      *_VS2019_IA32_MAKE_FLAGS  = /nologo
+  DEBUG_VS2019_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
+RELEASE_VS2019_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
+NOOPT_VS2019_IA32_CC_FLAGS      = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
+
+  DEBUG_VS2019_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
+RELEASE_VS2019_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
+NOOPT_VS2019_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
+
+  DEBUG_VS2019_IA32_NASM_FLAGS  = -Ox -f win32 -g
+RELEASE_VS2019_IA32_NASM_FLAGS  = -Ox -f win32
+NOOPT_VS2019_IA32_NASM_FLAGS    = -O0 -f win32 -g
+
+  DEBUG_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+RELEASE_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
+NOOPT_VS2019_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+
+##################
+# X64 definitions
+##################
+*_VS2019_X64_CC_PATH       = DEF(VS2019_BIN_X64)\cl.exe
+*_VS2019_X64_PP_PATH       = DEF(VS2019_BIN_X64)\cl.exe
+*_VS2019_X64_APP_PATH      = DEF(VS2019_BIN_X64)\cl.exe
+*_VS2019_X64_VFRPP_PATH    = DEF(VS2019_BIN_X64)\cl.exe
+*_VS2019_X64_ASLCC_PATH    = DEF(VS2019_BIN_X64)\cl.exe
+*_VS2019_X64_ASLPP_PATH    = DEF(VS2019_BIN_X64)\cl.exe
+*_VS2019_X64_ASM_PATH      = DEF(VS2019_BIN_X64)\ml64.exe
+*_VS2019_X64_SLINK_PATH    = DEF(VS2019_BIN_X64)\lib.exe
+*_VS2019_X64_DLINK_PATH    = DEF(VS2019_BIN_X64)\link.exe
+*_VS2019_X64_ASLDLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
+
+  DEBUG_VS2019_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
+RELEASE_VS2019_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
+NOOPT_VS2019_X64_CC_FLAGS       = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
+
+  DEBUG_VS2019_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi
+RELEASE_VS2019_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd
+NOOPT_VS2019_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi
+
+  DEBUG_VS2019_X64_NASM_FLAGS   = -Ox -f win64 -g
+RELEASE_VS2019_X64_NASM_FLAGS   = -Ox -f win64
+NOOPT_VS2019_X64_NASM_FLAGS     = -O0 -f win64 -g
+
+  DEBUG_VS2019_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+RELEASE_VS2019_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
+NOOPT_VS2019_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
+
 ####################################################################################
 # GCC Common
 ####################################################################################
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] Add VS2019 Support on ToolSetup Batches
  2019-09-11  6:08 [PATCH 0/2] *** Add VS2019 Support *** Cheng, Ching JenX
  2019-09-11  6:08 ` [PATCH 1/2] Add VS2019 Toolchain def Cheng, Ching JenX
@ 2019-09-11  6:08 ` Cheng, Ching JenX
  2019-09-16 15:52   ` Liming Gao
  1 sibling, 1 reply; 7+ messages in thread
From: Cheng, Ching JenX @ 2019-09-11  6:08 UTC (permalink / raw)
  To: devel; +Cc: Amy Chan, Bob Feng, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2182

Inorder to support VS2019, we add VS2019 config process
in Setup Batch Files,
Because VS2019 and VS2017 could using same vswhere.exe
to detect the InstallationPath,
So we add the -version as the parameter of vswhere
to get the correct VS2017/VS2019's InstallationPath

Change-Id: I72d5ef66fd39d3d42b0b2ea57199b4fa27260ab6
Cc: Amy Chan <amy.chan@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com>
---
 BaseTools/get_vsvars.bat        | 39 +++++++++++++++++++++++++++++++--------
 BaseTools/set_vsprefix_envs.bat | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 BaseTools/toolsetup.bat         | 16 +++++++++++++---
 edksetup.bat                    |  6 ++++--
 4 files changed, 113 insertions(+), 18 deletions(-)

diff --git a/BaseTools/get_vsvars.bat b/BaseTools/get_vsvars.bat
index 9f3759b2a9..60c3a2c0b7 100644
--- a/BaseTools/get_vsvars.bat
+++ b/BaseTools/get_vsvars.bat
@@ -1,7 +1,7 @@
 @REM @file
 @REM   Windows batch file to find the Visual Studio set up script
 @REM
-@REM Copyright (c) 2013-2014, ARM Limited. All rights reserved.
+@REM Copyright (c) 2013-2019, ARM Limited. All rights reserved.
 
 @REM SPDX-License-Identifier: BSD-2-Clause-Patent
 @REM
@@ -10,15 +10,21 @@
 @echo off
 set SCRIPT_ERROR=0
 if "%1"=="" goto main
+if /I "%1"=="VS2019" goto VS2019Vars
 if /I "%1"=="VS2017" goto VS2017Vars
 if /I "%1"=="VS2015" goto VS2015Vars
 if /I "%1"=="VS2013" goto VS2013Vars
 if /I "%1"=="VS2012" goto VS2012Vars
 
 :set_vsvars
-for /f "usebackq tokens=1* delims=: " %%i in (`%*`) do (
-  if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
-)
+if defined VCINSTALLDIR goto :EOF
+  call %* > vswhereInfo
+  for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
+    if /i "%%i"=="installationPath" (
+      call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+    )
+  )
+  del vswhereInfo
 goto :EOF
 
 :read_vsvars
@@ -42,19 +48,36 @@ REM       (Or invoke the relevant vsvars32 file beforehand).
 
 :main
 if defined VCINSTALLDIR goto :done
+  :VS2019Vars
+  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
+    if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" (
+      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 16,17
+    ) else (
+      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17
+    )
+  )
+  if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
+    if exist "%ProgramFiles%\Microsoft Visual Studio\2019\BuildTools" (
+      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 16,17
+    ) else (
+      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17
+    )
+  )
+  if /I "%1"=="VS2019" goto ToolNotInstall
+
   :VS2017Vars
   if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
     if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" (
-      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools
+      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 15,16
     ) else (
-      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
+      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16
     )
   )
   if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
     if exist "%ProgramFiles%\Microsoft Visual Studio\2017\BuildTools" (
-      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools
+      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 15,16
     ) else (
-      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
+      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16
     )
   )
   if /I "%1"=="VS2017" goto ToolNotInstall
diff --git a/BaseTools/set_vsprefix_envs.bat b/BaseTools/set_vsprefix_envs.bat
index 81686f5b63..46b84713a6 100644
--- a/BaseTools/set_vsprefix_envs.bat
+++ b/BaseTools/set_vsprefix_envs.bat
@@ -3,7 +3,7 @@
 @REM   however it may be executed directly from the BaseTools project folder
 @REM   if the file is not executed within a WORKSPACE\BaseTools folder.
 @REM
-@REM Copyright (c) 2016-2017, Intel Corporation. All rights reserved.<BR>
+@REM Copyright (c) 2016-2019, Intel Corporation. All rights reserved.<BR>
 @REM
 @REM SPDX-License-Identifier: BSD-2-Clause-Patent
 @REM
@@ -18,6 +18,7 @@ set SCRIPT_ERROR=1
 goto :EOF
 
 :main
+if /I "%1"=="VS2019" goto SetVS2019
 if /I "%1"=="VS2017" goto SetVS2017
 if /I "%1"=="VS2015" goto SetVS2015
 if /I "%1"=="VS2013" goto SetVS2013
@@ -107,27 +108,86 @@ if defined VS140COMNTOOLS (
 )
 if /I "%1"=="VS2015" goto SetWinDDK
 
+:SetVS2019
+if not defined VS160COMNTOOLS (
+  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
+    if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" (
+      call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 16,17 > vswhereInfo
+      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
+        if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+      )
+      del vswhereInfo
+    ) else (
+      call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17 > vswhereInfo
+      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
+        if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+      )
+      del vswhereInfo
+    )
+  ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
+    if exist "%ProgramFiles%\Microsoft Visual Studio\2019\BuildTools" (
+      call "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 16,17 > vswhereInfo
+      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
+        if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+      )
+      del vswhereInfo
+    ) else (
+      call "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17 > vswhereInfo
+      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
+        if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
+      )
+      del vswhereInfo
+    )
+  ) else (
+    if /I "%1"=="VS2019" goto ToolNotInstall
+    goto SetWinDDK
+  )
+)
+
+if defined VCToolsInstallDir (
+  if not defined VS2019_PREFIX (
+    set "VS2019_PREFIX=%VCToolsInstallDir%"
+  )
+)
+if not defined WINSDK10_PREFIX (
+  if defined WindowsSdkVerBinPath (
+    set "WINSDK10_PREFIX=%WindowsSdkVerBinPath%"
+  ) else if exist "%ProgramFiles(x86)%\Windows Kits\10\bin" (
+    set "WINSDK10_PREFIX=%ProgramFiles(x86)%\Windows Kits\10\bin\"
+  ) else if exist "%ProgramFiles%\Windows Kits\10\bin" (
+    set "WINSDK10_PREFIX=%ProgramFiles%\Windows Kits\10\bin\"
+  )
+)
+
 :SetVS2017
 if not defined VS150COMNTOOLS (
   if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
     if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" (
-      for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools`) do (
+      call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 15,16 > vswhereInfo
+      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
         if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
       )
+      del vswhereInfo
     ) else (
-      for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
+      call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16 > vswhereInfo
+      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
         if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
       )
+      del vswhereInfo
     )
   ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
     if exist "%ProgramFiles%\Microsoft Visual Studio\2017\BuildTools" (
-      for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools`) do (
+      call "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version 15,16 > vswhereInfo
+      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
         if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
       )
+      del vswhereInfo
     ) else (
-      for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
+      call "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16 > vswhereInfo
+      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
         if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
       )
+      del vswhereInfo
     )
   ) else (
     if /I "%1"=="VS2017" goto ToolNotInstall
diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
index 395694fa09..61ebf4ae09 100755
--- a/BaseTools/toolsetup.bat
+++ b/BaseTools/toolsetup.bat
@@ -3,7 +3,7 @@
 @REM   however it may be executed directly from the BaseTools project folder
 @REM   if the file is not executed within a WORKSPACE\BaseTools folder.
 @REM
-@REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+@REM Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 @REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 @REM
 @REM SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -42,6 +42,12 @@ if /I "%1"=="/?" goto Usage
     set FORCE_REBUILD=TRUE
     goto loop
   )
+  if /I "%1"=="VS2019" (
+    shift
+    set VS2019=TRUE
+    set VSTool=VS2019
+    goto loop
+  )
   if /I "%1"=="VS2017" (
     shift
     set VS2017=TRUE
@@ -176,7 +182,9 @@ IF NOT exist "%EDK_TOOLS_PATH%\set_vsprefix_envs.bat" (
   @echo.
   goto end
 )
-if defined VS2017 (
+if defined VS2019 (
+  call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2019
+) else if defined VS2017 (
   call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2017
 ) else if defined VS2015 (
   call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2015
@@ -444,7 +452,7 @@ goto end
 
 :Usage
   @echo.
-  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2017] [VS2015] [VS2013] [VS2012]"
+  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2019] [VS2017] [VS2015] [VS2013] [VS2012]"
   @echo.
   @echo         base_tools_path   BaseTools project path, BASE_TOOLS_PATH will be set to this path.
   @echo         edk_tools_path    EDK_TOOLS_PATH will be set to this path.
@@ -457,12 +465,14 @@ goto end
   @echo         VS2013            Set the env for VS2013 build.
   @echo         VS2015            Set the env for VS2015 build.
   @echo         VS2017            Set the env for VS2017 build.
+  @echo         VS2019            Set the env for VS2019 build.
   @echo.
 
 :end
 set REBUILD=
 set FORCE_REBUILD=
 set RECONFIG=
+set VS2019=
 set VS2017=
 set VS2015=
 set VS2013=
diff --git a/edksetup.bat b/edksetup.bat
index 5f6028deff..024f57a4b7 100755
--- a/edksetup.bat
+++ b/edksetup.bat
@@ -1,7 +1,7 @@
 @REM @file
 @REM   Windows batch file to setup a WORKSPACE environment
 @REM
-@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+@REM Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 @REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 @REM SPDX-License-Identifier: BSD-2-Clause-Patent
 @REM
@@ -133,6 +133,7 @@ if defined CYGWIN_HOME (
 :cygwin_done
 if /I "%1"=="Rebuild" shift
 if /I "%1"=="ForceRebuild" shift
+if /I "%1"=="VS2019" shift
 if /I "%1"=="VS2017" shift
 if /I "%1"=="VS2015" shift
 if /I "%1"=="VS2013" shift
@@ -141,7 +142,7 @@ if "%1"=="" goto end
 
 :Usage
   @echo.
-  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Rebuild] [ForceRebuild] [VS2017] [VS2015] [VS2013] [VS2012]"
+  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Rebuild] [ForceRebuild] [VS2019] [VS2017] [VS2015] [VS2013] [VS2012]"
   @echo.
   @echo         Reconfig       Reinstall target.txt, tools_def.txt and build_rule.txt.
   @echo         Rebuild        Perform incremental rebuild of BaseTools binaries.
@@ -150,6 +151,7 @@ if "%1"=="" goto end
   @echo         VS2013         Set the env for VS2013 build.
   @echo         VS2015         Set the env for VS2015 build.
   @echo         VS2017         Set the env for VS2017 build.
+  @echo         VS2019         Set the env for VS2019 build.
   @echo.
   @echo  Note that target.template, tools_def.template and build_rules.template
   @echo  will only be copied to target.txt, tools_def.txt and build_rule.txt
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] Add VS2019 Toolchain def
  2019-09-11  6:08 ` [PATCH 1/2] Add VS2019 Toolchain def Cheng, Ching JenX
@ 2019-09-11 15:43   ` Pete Batard
  2019-09-16  2:25     ` Cheng, Ching JenX
  0 siblings, 1 reply; 7+ messages in thread
From: Pete Batard @ 2019-09-11 15:43 UTC (permalink / raw)
  To: devel, ching.jenx.cheng; +Cc: Amy Chan, Bob Feng, Liming Gao

Hi Ching JenX,

Please see two comments inline.

On 2019.09.11 07:08, Cheng, Ching JenX wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2182
> 
> In order to support VS2019,
> the first thing need to do is add 2019 toolchain on tools_def.template
> 
> Change-Id: Id52abdc9762cf06bb9a38bbfd1153608c878d839
> Cc: Amy Chan <amy.chan@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com>
> ---
>   BaseTools/Conf/tools_def.template | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
>   1 file changed, 122 insertions(+), 12 deletions(-)
> 
> diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
> index 8f0e6cb6c2..7585a3e5db 100755
> --- a/BaseTools/Conf/tools_def.template
> +++ b/BaseTools/Conf/tools_def.template
> @@ -63,27 +63,35 @@ DEFINE VS2017_BIN_X64     = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x64
>   DEFINE VS2017_BIN_ARM     = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm
>   DEFINE VS2017_BIN_AARCH64 = DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm64
>   
> -DEFINE WINSDK_BIN       = ENV(WINSDK_PREFIX)
> -DEFINE WINSDKx86_BIN    = ENV(WINSDKx86_PREFIX)
> +DEFINE VS2019_BIN         = ENV(VS2019_PREFIX)bin
> +DEFINE VS2019_HOST        = x86
> +DEFINE VS2019_BIN_HOST    = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\DEF(VS2019_HOST)
> +DEFINE VS2019_BIN_IA32    = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\x86
> +DEFINE VS2019_BIN_X64     = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\x64
> +DEFINE VS2019_BIN_ARM     = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\arm
> +DEFINE VS2019_BIN_AARCH64 = DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\arm64
> +
> +DEFINE WINSDK_BIN           = ENV(WINSDK_PREFIX)
> +DEFINE WINSDKx86_BIN        = ENV(WINSDKx86_PREFIX)
>   
>   # Microsoft Visual Studio 2010
> -DEFINE WINSDK7_BIN       = ENV(WINSDK7_PREFIX)
> -DEFINE WINSDK7x86_BIN    = ENV(WINSDK7x86_PREFIX)
> +DEFINE WINSDK7_BIN          = ENV(WINSDK7_PREFIX)
> +DEFINE WINSDK7x86_BIN       = ENV(WINSDK7x86_PREFIX)
>   
>   # Microsoft Visual Studio 2012 Update 1 (required for rc.exe that was not included in the initial release)
> -DEFINE WINSDK71_BIN       = ENV(WINSDK71_PREFIX)
> -DEFINE WINSDK71x86_BIN    = ENV(WINSDK71x86_PREFIX)
> +DEFINE WINSDK71_BIN         = ENV(WINSDK71_PREFIX)
> +DEFINE WINSDK71x86_BIN      = ENV(WINSDK71x86_PREFIX)
>   
>   # Microsoft Visual Studio 2013 Professional Edition
> -DEFINE WINSDK8_BIN       = ENV(WINSDK8_PREFIX)x86\
> -DEFINE WINSDK8x86_BIN    = ENV(WINSDK8x86_PREFIX)x64
> +DEFINE WINSDK8_BIN          = ENV(WINSDK8_PREFIX)x86\
> +DEFINE WINSDK8x86_BIN       = ENV(WINSDK8x86_PREFIX)x64
>   
>   # Microsoft Visual Studio 2015 Professional Edition
> -DEFINE WINSDK81_BIN       = ENV(WINSDK81_PREFIX)x86\
> -DEFINE WINSDK81x86_BIN    = ENV(WINSDK81x86_PREFIX)x64
> +DEFINE WINSDK81_BIN         = ENV(WINSDK81_PREFIX)x86\
> +DEFINE WINSDK81x86_BIN      = ENV(WINSDK81x86_PREFIX)x64
>   
> -# Microsoft Visual Studio 2017 Professional Edition
> -DEFINE WINSDK10_BIN       = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
> +# Microsoft Visual Studio 2017/2019 Professional Edition
> +DEFINE WINSDK10_BIN         = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)

The above line does not use the VS2019_HOST defined above, so I think we 
want to fix that.

I wouldn't expect many people to use both VS2017 and VS2019 toolchains 
with a different host platform (e.g. x64 for VS2019 and x86 for VS2017) 
so I'd suggest that we use a single "VS_HOST" that applies to both 
platforms.

>   
>   # These defines are needed for certain Microsoft Visual Studio tools that
>   # are used by other toolchains.  An example is that ICC on Windows normally
> @@ -218,6 +226,17 @@ DEFINE DTC_BIN                 = ENV(DTC_PREFIX)dtc
>   #                        Note:
>   #                             Building of XIP firmware images for ARM/ARM64 is not currently supported (only applications).
>   #                             /FILEALIGN:4096 and other changes are needed for ARM firmware builds.
> +#   VS2019      -win32-  Requires:
> +#                             Microsoft Visual Studio 2019 version 16.2 or later
> +#                        Optional:
> +#                             Required to build EBC drivers:
> +#                               Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
> +#                             Required to build platforms or ACPI tables:
> +#                               Intel(r) ACPI Compiler (iasl.exe) from
> +#                               https://acpica.org/downloads
> +#                        Note:
> +#                             Building of XIP firmware images for ARM/ARM64 is not currently supported (only applications).
> +#                             /FILEALIGN:4096 and other changes are needed for ARM firmware builds.
>   #   GCC48       -Linux,Windows-  Requires:
>   #                             GCC 4.8 targeting x86_64-linux-gnu, aarch64-linux-gnu, or arm-linux-gnueabi
>   #                        Optional:
> @@ -1691,6 +1710,97 @@ NOOPT_VS2017_AARCH64_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
>   *_VS2017_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC
>   *_VS2017_EBC_DLINK_FLAGS         = "C:\Program Files (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
>   
> +####################################################################################
> +#   VS2019       - Microsoft Visual Studio 2017 with Intel ASL
> +#   ASL          - Intel ACPI Source Language Compiler (iasl.exe)
> +####################################################################################
> +#   VS2019           - Microsoft Visual Studio 2017 professional Edition with Intel ASL
> +*_VS2019_*_*_FAMILY        = MSFT
> +*_VS2019_*_*_DLL           = DEF(VS2019_BIN_HOST)
> +
> +*_VS2019_*_MAKE_PATH       = DEF(VS2019_BIN_HOST)\nmake.exe
> +*_VS2019_*_MAKE_FLAG       = /nologo
> +*_VS2019_*_RC_PATH         = DEF(WINSDK10_BIN)\rc.exe
> +
> +*_VS2019_*_MAKE_FLAGS      = /nologo
> +*_VS2019_*_SLINK_FLAGS     = /NOLOGO /LTCG
> +*_VS2019_*_APP_FLAGS       = /nologo /E /TC
> +*_VS2019_*_PP_FLAGS        = /nologo /E /TC /FIAutoGen.h
> +*_VS2019_*_VFRPP_FLAGS     = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
> +*_VS2019_*_DLINK2_FLAGS    = /WHOLEARCHIVE
> +*_VS2019_*_ASM16_PATH      = DEF(VS2019_BIN_IA32)\ml.exe
> +
> +##################
> +# ASL definitions
> +##################
> +*_VS2019_*_ASL_PATH        = DEF(WIN_IASL_BIN)
> +*_VS2019_*_ASL_FLAGS       = DEF(DEFAULT_WIN_ASL_FLAGS)
> +*_VS2019_*_ASL_OUTFLAGS    = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
> +*_VS2019_*_ASLCC_FLAGS     = DEF(MSFT_ASLCC_FLAGS)
> +*_VS2019_*_ASLPP_FLAGS     = DEF(MSFT_ASLPP_FLAGS)
> +*_VS2019_*_ASLDLINK_FLAGS  = DEF(MSFT_ASLDLINK_FLAGS)
> +
> +##################
> +# IA32 definitions
> +##################
> +*_VS2019_IA32_CC_PATH      = DEF(VS2019_BIN_IA32)\cl.exe
> +*_VS2019_IA32_VFRPP_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
> +*_VS2019_IA32_ASLCC_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
> +*_VS2019_IA32_ASLPP_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
> +*_VS2019_IA32_SLINK_PATH   = DEF(VS2019_BIN_IA32)\lib.exe
> +*_VS2019_IA32_DLINK_PATH   = DEF(VS2019_BIN_IA32)\link.exe
> +*_VS2019_IA32_ASLDLINK_PATH= DEF(VS2019_BIN_IA32)\link.exe
> +*_VS2019_IA32_APP_PATH     = DEF(VS2019_BIN_IA32)\cl.exe
> +*_VS2019_IA32_PP_PATH      = DEF(VS2019_BIN_IA32)\cl.exe
> +*_VS2019_IA32_ASM_PATH     = DEF(VS2019_BIN_IA32)\ml.exe
> +
> +      *_VS2019_IA32_MAKE_FLAGS  = /nologo
> +  DEBUG_VS2019_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw /MP
> +RELEASE_VS2019_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
> +NOOPT_VS2019_IA32_CC_FLAGS      = /nologo /arch:IA32 /c /WX /GS- /W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
> +
> +  DEBUG_VS2019_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
> +RELEASE_VS2019_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
> +NOOPT_VS2019_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd /Zi
> +
> +  DEBUG_VS2019_IA32_NASM_FLAGS  = -Ox -f win32 -g
> +RELEASE_VS2019_IA32_NASM_FLAGS  = -Ox -f win32
> +NOOPT_VS2019_IA32_NASM_FLAGS    = -O0 -f win32 -g
> +
> +  DEBUG_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
> +RELEASE_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
> +NOOPT_VS2019_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
> +
> +##################
> +# X64 definitions
> +##################
> +*_VS2019_X64_CC_PATH       = DEF(VS2019_BIN_X64)\cl.exe
> +*_VS2019_X64_PP_PATH       = DEF(VS2019_BIN_X64)\cl.exe
> +*_VS2019_X64_APP_PATH      = DEF(VS2019_BIN_X64)\cl.exe
> +*_VS2019_X64_VFRPP_PATH    = DEF(VS2019_BIN_X64)\cl.exe
> +*_VS2019_X64_ASLCC_PATH    = DEF(VS2019_BIN_X64)\cl.exe
> +*_VS2019_X64_ASLPP_PATH    = DEF(VS2019_BIN_X64)\cl.exe
> +*_VS2019_X64_ASM_PATH      = DEF(VS2019_BIN_X64)\ml64.exe
> +*_VS2019_X64_SLINK_PATH    = DEF(VS2019_BIN_X64)\lib.exe
> +*_VS2019_X64_DLINK_PATH    = DEF(VS2019_BIN_X64)\link.exe
> +*_VS2019_X64_ASLDLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
> +
> +  DEBUG_VS2019_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
> +RELEASE_VS2019_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
> +NOOPT_VS2019_X64_CC_FLAGS       = /nologo /c /WX /GS- /W4 /Gs32768 /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
> +
> +  DEBUG_VS2019_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi
> +RELEASE_VS2019_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd
> +NOOPT_VS2019_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi
> +
> +  DEBUG_VS2019_X64_NASM_FLAGS   = -Ox -f win64 -g
> +RELEASE_VS2019_X64_NASM_FLAGS   = -Ox -f win64
> +NOOPT_VS2019_X64_NASM_FLAGS     = -O0 -f win64 -g
> +
> +  DEBUG_VS2019_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
> +RELEASE_VS2019_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
> +NOOPT_VS2019_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG

Why are there no ARM, AARCH64 and EBC definitions, like there are for 
VS2017?

I am afraid there are some of us here that are actually mad enough to 
want to build ARM and AARCH64 EDK2 projects using Visual Studio... ;)

If it helps, I can confirm that simply copy/pasting the VS2017 sections 
and replacing all of the "VS2017" instances with "VS2019" appears to 
work just fine when compiling my ARM/AARCH64 projects. I haven't tested 
EBC, but I expect the same to be true.

Apart from that, both patches look good to me.

Regards,

/Pete

> +
>   ####################################################################################
>   # GCC Common
>   ####################################################################################
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] Add VS2019 Toolchain def
  2019-09-11 15:43   ` [edk2-devel] " Pete Batard
@ 2019-09-16  2:25     ` Cheng, Ching JenX
  2019-09-16  9:47       ` Pete Batard
  0 siblings, 1 reply; 7+ messages in thread
From: Cheng, Ching JenX @ 2019-09-16  2:25 UTC (permalink / raw)
  To: devel@edk2.groups.io, pete@akeo.ie; +Cc: Chan, Amy, Feng, Bob C, Gao, Liming

Hi Peter,

Thanks for your kind comments,
For the following comments
1. I will combine VS2017_HOST and VS2019_HOST to VS_HOST to apply both VS2017 and VS2019 plateforms,
2. Sorry I just test x86/64 builds. So if it is ok, please help me to test ARM/AARCH64. Then I could update it to patch v2.

Thank you,
Best Regards,
Allen

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Pete Batard
> Sent: Wednesday, September 11, 2019 11:43 PM
> To: devel@edk2.groups.io; Cheng, Ching JenX
> <ching.jenx.cheng@intel.com>
> Cc: Chan, Amy <amy.chan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>;
> Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2-devel] [PATCH 1/2] Add VS2019 Toolchain def
> 
> Hi Ching JenX,
> 
> Please see two comments inline.
> 
> On 2019.09.11 07:08, Cheng, Ching JenX wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2182
> >
> > In order to support VS2019,
> > the first thing need to do is add 2019 toolchain on tools_def.template
> >
> > Change-Id: Id52abdc9762cf06bb9a38bbfd1153608c878d839
> > Cc: Amy Chan <amy.chan@intel.com>
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <liming.gao@intel.com>
> > Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com>
> > ---
> >   BaseTools/Conf/tools_def.template | 134
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++------------
> >   1 file changed, 122 insertions(+), 12 deletions(-)
> >
> > diff --git a/BaseTools/Conf/tools_def.template
> > b/BaseTools/Conf/tools_def.template
> > index 8f0e6cb6c2..7585a3e5db 100755
> > --- a/BaseTools/Conf/tools_def.template
> > +++ b/BaseTools/Conf/tools_def.template
> > @@ -63,27 +63,35 @@ DEFINE VS2017_BIN_X64     =
> DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x64
> >   DEFINE VS2017_BIN_ARM     =
> DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm
> >   DEFINE VS2017_BIN_AARCH64 =
> > DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm64
> >
> > -DEFINE WINSDK_BIN       = ENV(WINSDK_PREFIX)
> > -DEFINE WINSDKx86_BIN    = ENV(WINSDKx86_PREFIX)
> > +DEFINE VS2019_BIN         = ENV(VS2019_PREFIX)bin
> > +DEFINE VS2019_HOST        = x86
> > +DEFINE VS2019_BIN_HOST    =
> DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\DEF(VS2019_HOST)
> > +DEFINE VS2019_BIN_IA32    =
> DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\x86
> > +DEFINE VS2019_BIN_X64     =
> DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\x64
> > +DEFINE VS2019_BIN_ARM     =
> DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\arm
> > +DEFINE VS2019_BIN_AARCH64 =
> > +DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\arm64
> > +
> > +DEFINE WINSDK_BIN           = ENV(WINSDK_PREFIX)
> > +DEFINE WINSDKx86_BIN        = ENV(WINSDKx86_PREFIX)
> >
> >   # Microsoft Visual Studio 2010
> > -DEFINE WINSDK7_BIN       = ENV(WINSDK7_PREFIX)
> > -DEFINE WINSDK7x86_BIN    = ENV(WINSDK7x86_PREFIX)
> > +DEFINE WINSDK7_BIN          = ENV(WINSDK7_PREFIX)
> > +DEFINE WINSDK7x86_BIN       = ENV(WINSDK7x86_PREFIX)
> >
> >   # Microsoft Visual Studio 2012 Update 1 (required for rc.exe that was not
> included in the initial release)
> > -DEFINE WINSDK71_BIN       = ENV(WINSDK71_PREFIX)
> > -DEFINE WINSDK71x86_BIN    = ENV(WINSDK71x86_PREFIX)
> > +DEFINE WINSDK71_BIN         = ENV(WINSDK71_PREFIX)
> > +DEFINE WINSDK71x86_BIN      = ENV(WINSDK71x86_PREFIX)
> >
> >   # Microsoft Visual Studio 2013 Professional Edition
> > -DEFINE WINSDK8_BIN       = ENV(WINSDK8_PREFIX)x86\
> > -DEFINE WINSDK8x86_BIN    = ENV(WINSDK8x86_PREFIX)x64
> > +DEFINE WINSDK8_BIN          = ENV(WINSDK8_PREFIX)x86\
> > +DEFINE WINSDK8x86_BIN       = ENV(WINSDK8x86_PREFIX)x64
> >
> >   # Microsoft Visual Studio 2015 Professional Edition
> > -DEFINE WINSDK81_BIN       = ENV(WINSDK81_PREFIX)x86\
> > -DEFINE WINSDK81x86_BIN    = ENV(WINSDK81x86_PREFIX)x64
> > +DEFINE WINSDK81_BIN         = ENV(WINSDK81_PREFIX)x86\
> > +DEFINE WINSDK81x86_BIN      = ENV(WINSDK81x86_PREFIX)x64
> >
> > -# Microsoft Visual Studio 2017 Professional Edition
> > -DEFINE WINSDK10_BIN       = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
> > +# Microsoft Visual Studio 2017/2019 Professional Edition
> > +DEFINE WINSDK10_BIN         = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
> 
> The above line does not use the VS2019_HOST defined above, so I think we
> want to fix that.
> 
> I wouldn't expect many people to use both VS2017 and VS2019 toolchains
> with a different host platform (e.g. x64 for VS2019 and x86 for VS2017) so I'd
> suggest that we use a single "VS_HOST" that applies to both platforms.
> 
> >
> >   # These defines are needed for certain Microsoft Visual Studio tools that
> >   # are used by other toolchains.  An example is that ICC on Windows
> normally
> > @@ -218,6 +226,17 @@ DEFINE DTC_BIN                 = ENV(DTC_PREFIX)dtc
> >   #                        Note:
> >   #                             Building of XIP firmware images for ARM/ARM64 is not
> currently supported (only applications).
> >   #                             /FILEALIGN:4096 and other changes are needed for ARM
> firmware builds.
> > +#   VS2019      -win32-  Requires:
> > +#                             Microsoft Visual Studio 2019 version 16.2 or later
> > +#                        Optional:
> > +#                             Required to build EBC drivers:
> > +#                               Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
> > +#                             Required to build platforms or ACPI tables:
> > +#                               Intel(r) ACPI Compiler (iasl.exe) from
> > +#                               https://acpica.org/downloads
> > +#                        Note:
> > +#                             Building of XIP firmware images for ARM/ARM64 is not
> currently supported (only applications).
> > +#                             /FILEALIGN:4096 and other changes are needed for ARM
> firmware builds.
> >   #   GCC48       -Linux,Windows-  Requires:
> >   #                             GCC 4.8 targeting x86_64-linux-gnu, aarch64-linux-gnu, or
> arm-linux-gnueabi
> >   #                        Optional:
> > @@ -1691,6 +1710,97 @@ NOOPT_VS2017_AARCH64_DLINK_FLAGS   =
> /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
> >   *_VS2017_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC
> >   *_VS2017_EBC_DLINK_FLAGS         = "C:\Program Files
> (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC
> /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT)
> /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
> >
> >
> +#########################################################
> ###########################
> > +#   VS2019       - Microsoft Visual Studio 2017 with Intel ASL
> > +#   ASL          - Intel ACPI Source Language Compiler (iasl.exe)
> >
> +#########################################################
> ###########################
> > +#   VS2019           - Microsoft Visual Studio 2017 professional Edition with
> Intel ASL
> > +*_VS2019_*_*_FAMILY        = MSFT
> > +*_VS2019_*_*_DLL           = DEF(VS2019_BIN_HOST)
> > +
> > +*_VS2019_*_MAKE_PATH       = DEF(VS2019_BIN_HOST)\nmake.exe
> > +*_VS2019_*_MAKE_FLAG       = /nologo
> > +*_VS2019_*_RC_PATH         = DEF(WINSDK10_BIN)\rc.exe
> > +
> > +*_VS2019_*_MAKE_FLAGS      = /nologo
> > +*_VS2019_*_SLINK_FLAGS     = /NOLOGO /LTCG
> > +*_VS2019_*_APP_FLAGS       = /nologo /E /TC
> > +*_VS2019_*_PP_FLAGS        = /nologo /E /TC /FIAutoGen.h
> > +*_VS2019_*_VFRPP_FLAGS     = /nologo /E /TC /DVFRCOMPILE
> /FI$(MODULE_NAME)StrDefs.h
> > +*_VS2019_*_DLINK2_FLAGS    = /WHOLEARCHIVE
> > +*_VS2019_*_ASM16_PATH      = DEF(VS2019_BIN_IA32)\ml.exe
> > +
> > +##################
> > +# ASL definitions
> > +##################
> > +*_VS2019_*_ASL_PATH        = DEF(WIN_IASL_BIN)
> > +*_VS2019_*_ASL_FLAGS       = DEF(DEFAULT_WIN_ASL_FLAGS)
> > +*_VS2019_*_ASL_OUTFLAGS    = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
> > +*_VS2019_*_ASLCC_FLAGS     = DEF(MSFT_ASLCC_FLAGS)
> > +*_VS2019_*_ASLPP_FLAGS     = DEF(MSFT_ASLPP_FLAGS)
> > +*_VS2019_*_ASLDLINK_FLAGS  = DEF(MSFT_ASLDLINK_FLAGS)
> > +
> > +##################
> > +# IA32 definitions
> > +##################
> > +*_VS2019_IA32_CC_PATH      = DEF(VS2019_BIN_IA32)\cl.exe
> > +*_VS2019_IA32_VFRPP_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
> > +*_VS2019_IA32_ASLCC_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
> > +*_VS2019_IA32_ASLPP_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
> > +*_VS2019_IA32_SLINK_PATH   = DEF(VS2019_BIN_IA32)\lib.exe
> > +*_VS2019_IA32_DLINK_PATH   = DEF(VS2019_BIN_IA32)\link.exe
> > +*_VS2019_IA32_ASLDLINK_PATH= DEF(VS2019_BIN_IA32)\link.exe
> > +*_VS2019_IA32_APP_PATH     = DEF(VS2019_BIN_IA32)\cl.exe
> > +*_VS2019_IA32_PP_PATH      = DEF(VS2019_BIN_IA32)\cl.exe
> > +*_VS2019_IA32_ASM_PATH     = DEF(VS2019_BIN_IA32)\ml.exe
> > +
> > +      *_VS2019_IA32_MAKE_FLAGS  = /nologo
> > +  DEBUG_VS2019_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4
> /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7
> /Gw /MP
> > +RELEASE_VS2019_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4
> /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
> > +NOOPT_VS2019_IA32_CC_FLAGS      = /nologo /arch:IA32 /c /WX /GS- /W4
> /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
> > +
> > +  DEBUG_VS2019_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
> /Zi
> > +RELEASE_VS2019_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
> > +NOOPT_VS2019_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd
> /Zi
> > +
> > +  DEBUG_VS2019_IA32_NASM_FLAGS  = -Ox -f win32 -g
> > +RELEASE_VS2019_IA32_NASM_FLAGS  = -Ox -f win32
> > +NOOPT_VS2019_IA32_NASM_FLAGS    = -O0 -f win32 -g
> > +
> > +  DEBUG_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB
> /IGNORE:4001
> > +/OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
> /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL
> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
> /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
> RELEASE_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB
> /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32
> /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL
> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
> /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
> > +NOOPT_VS2019_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB
> /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
> /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL
> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
> /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
> > +
> > +##################
> > +# X64 definitions
> > +##################
> > +*_VS2019_X64_CC_PATH       = DEF(VS2019_BIN_X64)\cl.exe
> > +*_VS2019_X64_PP_PATH       = DEF(VS2019_BIN_X64)\cl.exe
> > +*_VS2019_X64_APP_PATH      = DEF(VS2019_BIN_X64)\cl.exe
> > +*_VS2019_X64_VFRPP_PATH    = DEF(VS2019_BIN_X64)\cl.exe
> > +*_VS2019_X64_ASLCC_PATH    = DEF(VS2019_BIN_X64)\cl.exe
> > +*_VS2019_X64_ASLPP_PATH    = DEF(VS2019_BIN_X64)\cl.exe
> > +*_VS2019_X64_ASM_PATH      = DEF(VS2019_BIN_X64)\ml64.exe
> > +*_VS2019_X64_SLINK_PATH    = DEF(VS2019_BIN_X64)\lib.exe
> > +*_VS2019_X64_DLINK_PATH    = DEF(VS2019_BIN_X64)\link.exe
> > +*_VS2019_X64_ASLDLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
> > +
> > +  DEBUG_VS2019_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768
> /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
> > +RELEASE_VS2019_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768
> /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
> > +NOOPT_VS2019_X64_CC_FLAGS       = /nologo /c /WX /GS- /W4 /Gs32768
> /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
> > +
> > +  DEBUG_VS2019_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi
> > +RELEASE_VS2019_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd
> > +NOOPT_VS2019_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi
> > +
> > +  DEBUG_VS2019_X64_NASM_FLAGS   = -Ox -f win64 -g
> > +RELEASE_VS2019_X64_NASM_FLAGS   = -Ox -f win64
> > +NOOPT_VS2019_X64_NASM_FLAGS     = -O0 -f win64 -g
> > +
> > +  DEBUG_VS2019_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB
> /IGNORE:4001
> > +/IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
> /SECTION:.pdata,D /Machine:X64 /LTCG /DLL
> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
> /SAFESEH:NO /BASE:0 /DRIVER /DEBUG RELEASE_VS2019_X64_DLINK_FLAGS
> = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /IGNORE:4254
> /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
> /SECTION:.pdata,D /Machine:X64 /LTCG /DLL
> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
> /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
> > +NOOPT_VS2019_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB
> /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32
> /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL
> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
> /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
> 
> Why are there no ARM, AARCH64 and EBC definitions, like there are for
> VS2017?
> 
> I am afraid there are some of us here that are actually mad enough to want
> to build ARM and AARCH64 EDK2 projects using Visual Studio... ;)
> 
> If it helps, I can confirm that simply copy/pasting the VS2017 sections and
> replacing all of the "VS2017" instances with "VS2019" appears to work just
> fine when compiling my ARM/AARCH64 projects. I haven't tested EBC, but I
> expect the same to be true.
> 
> Apart from that, both patches look good to me.
> 
> Regards,
> 
> /Pete
> 
> > +
> >
> ##########################################################
> ##########################
> >   # GCC Common
> >
> >
> ##########################################################
> ############
> > ##############
> >
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] Add VS2019 Toolchain def
  2019-09-16  2:25     ` Cheng, Ching JenX
@ 2019-09-16  9:47       ` Pete Batard
  0 siblings, 0 replies; 7+ messages in thread
From: Pete Batard @ 2019-09-16  9:47 UTC (permalink / raw)
  To: Cheng, Ching JenX, devel@edk2.groups.io
  Cc: Chan, Amy, Feng, Bob C, Gao, Liming

Hi Allen,

On 2019.09.16 03:25, Cheng, Ching JenX wrote:
> Hi Peter,
> 
> Thanks for your kind comments,
> For the following comments
> 1. I will combine VS2017_HOST and VS2019_HOST to VS_HOST to apply both VS2017 and VS2019 plateforms,

Great.

> 2. Sorry I just test x86/64 builds. So if it is ok, please help me to test ARM/AARCH64. Then I could update it to patch v2.

I'll be happy to help. Using Visual Studio 2019 to compile for 
ARM/AARCH64 is fairly easy. Here are the steps you should follow:

1. You must make sure that, when you installed Visual Studio 2019, you 
also installed the ARM and ARM64 build tools. These are usually not 
installed by default, so, if you haven't already done so, or want to 
confirm that they are installed, you need to launch the Visual Studio 
Installer and then select Modify -> Individual Components. There you 
need to make sure that you have both "MSVC v142 - VS 2019 C++ ARM build 
tools (v14.22)" and "MSVC v142 - VS 2019 C++ ARM64 build tools (v14.22)" 
selected.

You can find a picture illustrating that step at: 
https://github.com/pbatard/uefi-simple#visual-studio-2019-and-armarm64-support


2. Copy the "# ARM definitions", "# AARCH64 definitions" and "# EBC 
definitions" below (just copy the whole section between the markers) and 
add them right before the "# GCC Common" section in tools_def.template.

These are the exact same sections as the ones we use for VS2017, except 
all instances of "VS2017" have been replaced with "VS2019". Nothing else 
was changed.

########################## BEGIN COPY HERE ##########################

#################
# ARM definitions
#################
*_VS2019_ARM_CC_PATH              = DEF(VS2019_BIN_ARM)\cl.exe
*_VS2019_ARM_VFRPP_PATH           = DEF(VS2019_BIN_ARM)\cl.exe
*_VS2019_ARM_SLINK_PATH           = DEF(VS2019_BIN_ARM)\lib.exe
*_VS2019_ARM_DLINK_PATH           = DEF(VS2019_BIN_ARM)\link.exe
*_VS2019_ARM_APP_PATH             = DEF(VS2019_BIN_ARM)\cl.exe
*_VS2019_ARM_PP_PATH              = DEF(VS2019_BIN_ARM)\cl.exe
*_VS2019_ARM_ASM_PATH             = DEF(VS2019_BIN_ARM)\armasm.exe
*_VS2019_ARM_ASLCC_PATH           = DEF(VS2019_BIN_ARM)\cl.exe
*_VS2019_ARM_ASLPP_PATH           = DEF(VS2019_BIN_ARM)\cl.exe
*_VS2019_ARM_ASLDLINK_PATH        = DEF(VS2019_BIN_ARM)\link.exe

       *_VS2019_ARM_MAKE_FLAGS     = /nologo
   DEBUG_VS2019_ARM_CC_FLAGS       = /nologo /c /WX /GS- /W4 /Gs32768 /D 
UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Gw /Oi-
RELEASE_VS2019_ARM_CC_FLAGS       = /nologo /c /WX /GS- /W4 /Gs32768 /D 
UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /Oi-
NOOPT_VS2019_ARM_CC_FLAGS         = /nologo /c /WX /GS- /W4 /Gs32768 /D 
UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od /Oi-

   DEBUG_VS2019_ARM_ASM_FLAGS      = /nologo /g
RELEASE_VS2019_ARM_ASM_FLAGS      = /nologo
NOOPT_VS2019_ARM_ASM_FLAGS        = /nologo

   DEBUG_VS2019_ARM_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 
/OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D 
/MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) 
/SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
RELEASE_VS2019_ARM_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB /IGNORE:4001 
/IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D 
/SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) 
/SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER 
/MERGE:.rdata=.data
NOOPT_VS2019_ARM_DLINK_FLAGS      = /NOLOGO /NODEFAULTLIB /IGNORE:4001 
/OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D 
/MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) 
/SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG

#####################
# AARCH64 definitions
#####################
*_VS2019_AARCH64_CC_PATH           = DEF(VS2019_BIN_AARCH64)\cl.exe
*_VS2019_AARCH64_VFRPP_PATH        = DEF(VS2019_BIN_AARCH64)\cl.exe
*_VS2019_AARCH64_SLINK_PATH        = DEF(VS2019_BIN_AARCH64)\lib.exe
*_VS2019_AARCH64_DLINK_PATH        = DEF(VS2019_BIN_AARCH64)\link.exe
*_VS2019_AARCH64_APP_PATH          = DEF(VS2019_BIN_AARCH64)\cl.exe
*_VS2019_AARCH64_PP_PATH           = DEF(VS2019_BIN_AARCH64)\cl.exe
*_VS2019_AARCH64_ASM_PATH          = DEF(VS2019_BIN_AARCH64)\armasm64.exe
*_VS2019_AARCH64_ASLCC_PATH        = DEF(VS2019_BIN_AARCH64)\cl.exe
*_VS2019_AARCH64_ASLPP_PATH        = DEF(VS2019_BIN_AARCH64)\cl.exe
*_VS2019_AARCH64_ASLDLINK_PATH     = DEF(VS2019_BIN_AARCH64)\link.exe

       *_VS2019_AARCH64_MAKE_FLAGS  = /nologo
   DEBUG_VS2019_AARCH64_CC_FLAGS    = /nologo /c /WX /GS- /W4 /Gs32768 
/D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Gw /Oi-
RELEASE_VS2019_AARCH64_CC_FLAGS    = /nologo /c /WX /GS- /W4 /Gs32768 /D 
UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /Oi-
NOOPT_VS2019_AARCH64_CC_FLAGS      = /nologo /c /WX /GS- /W4 /Gs32768 /D 
UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od /Oi-

   DEBUG_VS2019_AARCH64_ASM_FLAGS   = /nologo /g
RELEASE_VS2019_AARCH64_ASM_FLAGS   = /nologo
NOOPT_VS2019_AARCH64_ASM_FLAGS     = /nologo

   DEBUG_VS2019_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 
/OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D 
/MACHINE:ARM64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) 
/SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /DRIVER /DEBUG
RELEASE_VS2019_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 
/IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D 
/SECTION:.pdata,D /MACHINE:ARM64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) 
/SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /DRIVER /MERGE:.rdata=.data
NOOPT_VS2019_AARCH64_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB /IGNORE:4001 
/OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D 
/MACHINE:ARM64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) 
/SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /DRIVER /DEBUG

##################
# EBC definitions
##################
*_VS2019_EBC_*_FAMILY            = INTEL

*_VS2019_EBC_PP_PATH             = DEF(EBC_BINx86)\iec.exe
*_VS2019_EBC_VFRPP_PATH          = DEF(EBC_BINx86)\iec.exe
*_VS2019_EBC_CC_PATH             = DEF(EBC_BINx86)\iec.exe
*_VS2019_EBC_SLINK_PATH          = DEF(VS2019_BIN_IA32)\link.exe
*_VS2019_EBC_DLINK_PATH          = DEF(VS2019_BIN_IA32)\link.exe

*_VS2019_EBC_MAKE_FLAGS          = /nologo
*_VS2019_EBC_PP_FLAGS            = /nologo /E /TC /FIAutoGen.h
*_VS2019_EBC_CC_FLAGS            = /nologo /c /WX /W3 /FIAutoGen.h 
/D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT)
*_VS2019_EBC_VFRPP_FLAGS         = /nologo /E /TC /DVFRCOMPILE 
/FI$(MODULE_NAME)StrDefs.h
*_VS2019_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC
*_VS2019_EBC_DLINK_FLAGS         = "C:\Program Files 
(x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC 
/OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER 
/MAP /ALIGN:32 /DRIVER

########################## END COPY HERE ##########################


3. With the above completed, you should e able to compile something like 
ShellPkg for ARM/AARCH64 by issuing:

# ARM
C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_arm.bat"
edksetup.bat reconfig
build -a ARM -b RELEASE -t VS2019 -p ShellPkg/ShellPkg.dsc

# AARCH64
C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
edksetup.bat reconfig
build -a AARCH64 -b RELEASE -t VS2019 -p ShellPkg/ShellPkg.dsc


I have tested ShellPkg as well as other custom applications 
recompilation with VS2019 for ARM/AARCH64 on my platform, and found no 
issues.

If you need more details, please let me know.

Regards,

/Pete

> 
> Thank you,
> Best Regards,
> Allen
> 
>> -----Original Message-----
>> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>> Pete Batard
>> Sent: Wednesday, September 11, 2019 11:43 PM
>> To: devel@edk2.groups.io; Cheng, Ching JenX
>> <ching.jenx.cheng@intel.com>
>> Cc: Chan, Amy <amy.chan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>;
>> Gao, Liming <liming.gao@intel.com>
>> Subject: Re: [edk2-devel] [PATCH 1/2] Add VS2019 Toolchain def
>>
>> Hi Ching JenX,
>>
>> Please see two comments inline.
>>
>> On 2019.09.11 07:08, Cheng, Ching JenX wrote:
>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2182
>>>
>>> In order to support VS2019,
>>> the first thing need to do is add 2019 toolchain on tools_def.template
>>>
>>> Change-Id: Id52abdc9762cf06bb9a38bbfd1153608c878d839
>>> Cc: Amy Chan <amy.chan@intel.com>
>>> Cc: Bob Feng <bob.c.feng@intel.com>
>>> Cc: Liming Gao <liming.gao@intel.com>
>>> Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com>
>>> ---
>>>    BaseTools/Conf/tools_def.template | 134
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> ++++++------------
>>>    1 file changed, 122 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/BaseTools/Conf/tools_def.template
>>> b/BaseTools/Conf/tools_def.template
>>> index 8f0e6cb6c2..7585a3e5db 100755
>>> --- a/BaseTools/Conf/tools_def.template
>>> +++ b/BaseTools/Conf/tools_def.template
>>> @@ -63,27 +63,35 @@ DEFINE VS2017_BIN_X64     =
>> DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\x64
>>>    DEFINE VS2017_BIN_ARM     =
>> DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm
>>>    DEFINE VS2017_BIN_AARCH64 =
>>> DEF(VS2017_BIN)\HostDEF(VS2017_HOST)\arm64
>>>
>>> -DEFINE WINSDK_BIN       = ENV(WINSDK_PREFIX)
>>> -DEFINE WINSDKx86_BIN    = ENV(WINSDKx86_PREFIX)
>>> +DEFINE VS2019_BIN         = ENV(VS2019_PREFIX)bin
>>> +DEFINE VS2019_HOST        = x86
>>> +DEFINE VS2019_BIN_HOST    =
>> DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\DEF(VS2019_HOST)
>>> +DEFINE VS2019_BIN_IA32    =
>> DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\x86
>>> +DEFINE VS2019_BIN_X64     =
>> DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\x64
>>> +DEFINE VS2019_BIN_ARM     =
>> DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\arm
>>> +DEFINE VS2019_BIN_AARCH64 =
>>> +DEF(VS2019_BIN)\HostDEF(VS2019_HOST)\arm64
>>> +
>>> +DEFINE WINSDK_BIN           = ENV(WINSDK_PREFIX)
>>> +DEFINE WINSDKx86_BIN        = ENV(WINSDKx86_PREFIX)
>>>
>>>    # Microsoft Visual Studio 2010
>>> -DEFINE WINSDK7_BIN       = ENV(WINSDK7_PREFIX)
>>> -DEFINE WINSDK7x86_BIN    = ENV(WINSDK7x86_PREFIX)
>>> +DEFINE WINSDK7_BIN          = ENV(WINSDK7_PREFIX)
>>> +DEFINE WINSDK7x86_BIN       = ENV(WINSDK7x86_PREFIX)
>>>
>>>    # Microsoft Visual Studio 2012 Update 1 (required for rc.exe that was not
>> included in the initial release)
>>> -DEFINE WINSDK71_BIN       = ENV(WINSDK71_PREFIX)
>>> -DEFINE WINSDK71x86_BIN    = ENV(WINSDK71x86_PREFIX)
>>> +DEFINE WINSDK71_BIN         = ENV(WINSDK71_PREFIX)
>>> +DEFINE WINSDK71x86_BIN      = ENV(WINSDK71x86_PREFIX)
>>>
>>>    # Microsoft Visual Studio 2013 Professional Edition
>>> -DEFINE WINSDK8_BIN       = ENV(WINSDK8_PREFIX)x86\
>>> -DEFINE WINSDK8x86_BIN    = ENV(WINSDK8x86_PREFIX)x64
>>> +DEFINE WINSDK8_BIN          = ENV(WINSDK8_PREFIX)x86\
>>> +DEFINE WINSDK8x86_BIN       = ENV(WINSDK8x86_PREFIX)x64
>>>
>>>    # Microsoft Visual Studio 2015 Professional Edition
>>> -DEFINE WINSDK81_BIN       = ENV(WINSDK81_PREFIX)x86\
>>> -DEFINE WINSDK81x86_BIN    = ENV(WINSDK81x86_PREFIX)x64
>>> +DEFINE WINSDK81_BIN         = ENV(WINSDK81_PREFIX)x86\
>>> +DEFINE WINSDK81x86_BIN      = ENV(WINSDK81x86_PREFIX)x64
>>>
>>> -# Microsoft Visual Studio 2017 Professional Edition
>>> -DEFINE WINSDK10_BIN       = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
>>> +# Microsoft Visual Studio 2017/2019 Professional Edition
>>> +DEFINE WINSDK10_BIN         = ENV(WINSDK10_PREFIX)DEF(VS2017_HOST)
>>
>> The above line does not use the VS2019_HOST defined above, so I think we
>> want to fix that.
>>
>> I wouldn't expect many people to use both VS2017 and VS2019 toolchains
>> with a different host platform (e.g. x64 for VS2019 and x86 for VS2017) so I'd
>> suggest that we use a single "VS_HOST" that applies to both platforms.
>>
>>>
>>>    # These defines are needed for certain Microsoft Visual Studio tools that
>>>    # are used by other toolchains.  An example is that ICC on Windows
>> normally
>>> @@ -218,6 +226,17 @@ DEFINE DTC_BIN                 = ENV(DTC_PREFIX)dtc
>>>    #                        Note:
>>>    #                             Building of XIP firmware images for ARM/ARM64 is not
>> currently supported (only applications).
>>>    #                             /FILEALIGN:4096 and other changes are needed for ARM
>> firmware builds.
>>> +#   VS2019      -win32-  Requires:
>>> +#                             Microsoft Visual Studio 2019 version 16.2 or later
>>> +#                        Optional:
>>> +#                             Required to build EBC drivers:
>>> +#                               Intel(r) Compiler for Efi Byte Code (Intel(r) EBC Compiler)
>>> +#                             Required to build platforms or ACPI tables:
>>> +#                               Intel(r) ACPI Compiler (iasl.exe) from
>>> +#                               https://acpica.org/downloads
>>> +#                        Note:
>>> +#                             Building of XIP firmware images for ARM/ARM64 is not
>> currently supported (only applications).
>>> +#                             /FILEALIGN:4096 and other changes are needed for ARM
>> firmware builds.
>>>    #   GCC48       -Linux,Windows-  Requires:
>>>    #                             GCC 4.8 targeting x86_64-linux-gnu, aarch64-linux-gnu, or
>> arm-linux-gnueabi
>>>    #                        Optional:
>>> @@ -1691,6 +1710,97 @@ NOOPT_VS2017_AARCH64_DLINK_FLAGS   =
>> /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
>>>    *_VS2017_EBC_SLINK_FLAGS         = /lib /NOLOGO /MACHINE:EBC
>>>    *_VS2017_EBC_DLINK_FLAGS         = "C:\Program Files
>> (x86)\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC
>> /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT)
>> /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER
>>>
>>>
>> +#########################################################
>> ###########################
>>> +#   VS2019       - Microsoft Visual Studio 2017 with Intel ASL
>>> +#   ASL          - Intel ACPI Source Language Compiler (iasl.exe)
>>>
>> +#########################################################
>> ###########################
>>> +#   VS2019           - Microsoft Visual Studio 2017 professional Edition with
>> Intel ASL
>>> +*_VS2019_*_*_FAMILY        = MSFT
>>> +*_VS2019_*_*_DLL           = DEF(VS2019_BIN_HOST)
>>> +
>>> +*_VS2019_*_MAKE_PATH       = DEF(VS2019_BIN_HOST)\nmake.exe
>>> +*_VS2019_*_MAKE_FLAG       = /nologo
>>> +*_VS2019_*_RC_PATH         = DEF(WINSDK10_BIN)\rc.exe
>>> +
>>> +*_VS2019_*_MAKE_FLAGS      = /nologo
>>> +*_VS2019_*_SLINK_FLAGS     = /NOLOGO /LTCG
>>> +*_VS2019_*_APP_FLAGS       = /nologo /E /TC
>>> +*_VS2019_*_PP_FLAGS        = /nologo /E /TC /FIAutoGen.h
>>> +*_VS2019_*_VFRPP_FLAGS     = /nologo /E /TC /DVFRCOMPILE
>> /FI$(MODULE_NAME)StrDefs.h
>>> +*_VS2019_*_DLINK2_FLAGS    = /WHOLEARCHIVE
>>> +*_VS2019_*_ASM16_PATH      = DEF(VS2019_BIN_IA32)\ml.exe
>>> +
>>> +##################
>>> +# ASL definitions
>>> +##################
>>> +*_VS2019_*_ASL_PATH        = DEF(WIN_IASL_BIN)
>>> +*_VS2019_*_ASL_FLAGS       = DEF(DEFAULT_WIN_ASL_FLAGS)
>>> +*_VS2019_*_ASL_OUTFLAGS    = DEF(DEFAULT_WIN_ASL_OUTFLAGS)
>>> +*_VS2019_*_ASLCC_FLAGS     = DEF(MSFT_ASLCC_FLAGS)
>>> +*_VS2019_*_ASLPP_FLAGS     = DEF(MSFT_ASLPP_FLAGS)
>>> +*_VS2019_*_ASLDLINK_FLAGS  = DEF(MSFT_ASLDLINK_FLAGS)
>>> +
>>> +##################
>>> +# IA32 definitions
>>> +##################
>>> +*_VS2019_IA32_CC_PATH      = DEF(VS2019_BIN_IA32)\cl.exe
>>> +*_VS2019_IA32_VFRPP_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
>>> +*_VS2019_IA32_ASLCC_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
>>> +*_VS2019_IA32_ASLPP_PATH   = DEF(VS2019_BIN_IA32)\cl.exe
>>> +*_VS2019_IA32_SLINK_PATH   = DEF(VS2019_BIN_IA32)\lib.exe
>>> +*_VS2019_IA32_DLINK_PATH   = DEF(VS2019_BIN_IA32)\link.exe
>>> +*_VS2019_IA32_ASLDLINK_PATH= DEF(VS2019_BIN_IA32)\link.exe
>>> +*_VS2019_IA32_APP_PATH     = DEF(VS2019_BIN_IA32)\cl.exe
>>> +*_VS2019_IA32_PP_PATH      = DEF(VS2019_BIN_IA32)\cl.exe
>>> +*_VS2019_IA32_ASM_PATH     = DEF(VS2019_BIN_IA32)\ml.exe
>>> +
>>> +      *_VS2019_IA32_MAKE_FLAGS  = /nologo
>>> +  DEBUG_VS2019_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4
>> /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7
>> /Gw /MP
>>> +RELEASE_VS2019_IA32_CC_FLAGS    = /nologo /arch:IA32 /c /WX /GS- /W4
>> /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
>>> +NOOPT_VS2019_IA32_CC_FLAGS      = /nologo /arch:IA32 /c /WX /GS- /W4
>> /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od /MP
>>> +
>>> +  DEBUG_VS2019_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
>> /Zi
>>> +RELEASE_VS2019_IA32_ASM_FLAGS   = /nologo /c /WX /W3 /Cx /coff /Zd
>>> +NOOPT_VS2019_IA32_ASM_FLAGS     = /nologo /c /WX /W3 /Cx /coff /Zd
>> /Zi
>>> +
>>> +  DEBUG_VS2019_IA32_NASM_FLAGS  = -Ox -f win32 -g
>>> +RELEASE_VS2019_IA32_NASM_FLAGS  = -Ox -f win32
>>> +NOOPT_VS2019_IA32_NASM_FLAGS    = -O0 -f win32 -g
>>> +
>>> +  DEBUG_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB
>> /IGNORE:4001
>>> +/OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
>> /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL
>> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
>> /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
>> RELEASE_VS2019_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB
>> /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32
>> /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL
>> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
>> /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
>>> +NOOPT_VS2019_IA32_DLINK_FLAGS   = /NOLOGO /NODEFAULTLIB
>> /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
>> /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL
>> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
>> /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
>>> +
>>> +##################
>>> +# X64 definitions
>>> +##################
>>> +*_VS2019_X64_CC_PATH       = DEF(VS2019_BIN_X64)\cl.exe
>>> +*_VS2019_X64_PP_PATH       = DEF(VS2019_BIN_X64)\cl.exe
>>> +*_VS2019_X64_APP_PATH      = DEF(VS2019_BIN_X64)\cl.exe
>>> +*_VS2019_X64_VFRPP_PATH    = DEF(VS2019_BIN_X64)\cl.exe
>>> +*_VS2019_X64_ASLCC_PATH    = DEF(VS2019_BIN_X64)\cl.exe
>>> +*_VS2019_X64_ASLPP_PATH    = DEF(VS2019_BIN_X64)\cl.exe
>>> +*_VS2019_X64_ASM_PATH      = DEF(VS2019_BIN_X64)\ml64.exe
>>> +*_VS2019_X64_SLINK_PATH    = DEF(VS2019_BIN_X64)\lib.exe
>>> +*_VS2019_X64_DLINK_PATH    = DEF(VS2019_BIN_X64)\link.exe
>>> +*_VS2019_X64_ASLDLINK_PATH = DEF(VS2019_BIN_X64)\link.exe
>>> +
>>> +  DEBUG_VS2019_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768
>> /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw /MP
>>> +RELEASE_VS2019_X64_CC_FLAGS     = /nologo /c /WX /GS- /W4 /Gs32768
>> /D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw /MP
>>> +NOOPT_VS2019_X64_CC_FLAGS       = /nologo /c /WX /GS- /W4 /Gs32768
>> /D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od /MP
>>> +
>>> +  DEBUG_VS2019_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd /Zi
>>> +RELEASE_VS2019_X64_ASM_FLAGS    = /nologo /c /WX /W3 /Cx /Zd
>>> +NOOPT_VS2019_X64_ASM_FLAGS      = /nologo /c /WX /W3 /Cx /Zd /Zi
>>> +
>>> +  DEBUG_VS2019_X64_NASM_FLAGS   = -Ox -f win64 -g
>>> +RELEASE_VS2019_X64_NASM_FLAGS   = -Ox -f win64
>>> +NOOPT_VS2019_X64_NASM_FLAGS     = -O0 -f win64 -g
>>> +
>>> +  DEBUG_VS2019_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB
>> /IGNORE:4001
>>> +/IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
>> /SECTION:.pdata,D /Machine:X64 /LTCG /DLL
>> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
>> /SAFESEH:NO /BASE:0 /DRIVER /DEBUG RELEASE_VS2019_X64_DLINK_FLAGS
>> = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /IGNORE:4254
>> /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D
>> /SECTION:.pdata,D /Machine:X64 /LTCG /DLL
>> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
>> /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
>>> +NOOPT_VS2019_X64_DLINK_FLAGS    = /NOLOGO /NODEFAULTLIB
>> /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32
>> /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL
>> /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER
>> /SAFESEH:NO /BASE:0 /DRIVER /DEBUG
>>
>> Why are there no ARM, AARCH64 and EBC definitions, like there are for
>> VS2017?
>>
>> I am afraid there are some of us here that are actually mad enough to want
>> to build ARM and AARCH64 EDK2 projects using Visual Studio... ;)
>>
>> If it helps, I can confirm that simply copy/pasting the VS2017 sections and
>> replacing all of the "VS2017" instances with "VS2019" appears to work just
>> fine when compiling my ARM/AARCH64 projects. I haven't tested EBC, but I
>> expect the same to be true.
>>
>> Apart from that, both patches look good to me.
>>
>> Regards,
>>
>> /Pete
>>
>>> +
>>>
>> ##########################################################
>> ##########################
>>>    # GCC Common
>>>
>>>
>> ##########################################################
>> ############
>>> ##############
>>>
>>
>>
>> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] Add VS2019 Support on ToolSetup Batches
  2019-09-11  6:08 ` [PATCH 2/2] Add VS2019 Support on ToolSetup Batches Cheng, Ching JenX
@ 2019-09-16 15:52   ` Liming Gao
  0 siblings, 0 replies; 7+ messages in thread
From: Liming Gao @ 2019-09-16 15:52 UTC (permalink / raw)
  To: Cheng, Ching JenX, devel@edk2.groups.io; +Cc: Chan, Amy, Feng, Bob C

Jen: 
  I add my comments.

> -----Original Message-----
> From: Cheng, Ching JenX
> Sent: Wednesday, September 11, 2019 2:08 PM
> To: devel@edk2.groups.io
> Cc: Chan, Amy <amy.chan@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [PATCH 2/2] Add VS2019 Support on ToolSetup Batches
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2182
> 
> Inorder to support VS2019, we add VS2019 config process
> in Setup Batch Files,
> Because VS2019 and VS2017 could using same vswhere.exe
> to detect the InstallationPath,
> So we add the -version as the parameter of vswhere
> to get the correct VS2017/VS2019's InstallationPath
> 
> Change-Id: I72d5ef66fd39d3d42b0b2ea57199b4fa27260ab6
Remove Change-Id.

> Cc: Amy Chan <amy.chan@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Ching JenX Cheng <ching.jenx.cheng@intel.com>
> ---
>  BaseTools/get_vsvars.bat        | 39 +++++++++++++++++++++++++++++++--------
>  BaseTools/set_vsprefix_envs.bat | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
>  BaseTools/toolsetup.bat         | 16 +++++++++++++---
>  edksetup.bat                    |  6 ++++--
>  4 files changed, 113 insertions(+), 18 deletions(-)
> 
> diff --git a/BaseTools/get_vsvars.bat b/BaseTools/get_vsvars.bat
> index 9f3759b2a9..60c3a2c0b7 100644
> --- a/BaseTools/get_vsvars.bat
> +++ b/BaseTools/get_vsvars.bat
> @@ -1,7 +1,7 @@
>  @REM @file
>  @REM   Windows batch file to find the Visual Studio set up script
>  @REM
> -@REM Copyright (c) 2013-2014, ARM Limited. All rights reserved.
> +@REM Copyright (c) 2013-2019, ARM Limited. All rights reserved.

Don't update ARM Copyright.

Thanks
Liming
> 
>  @REM SPDX-License-Identifier: BSD-2-Clause-Patent
>  @REM
> @@ -10,15 +10,21 @@
>  @echo off
>  set SCRIPT_ERROR=0
>  if "%1"=="" goto main
> +if /I "%1"=="VS2019" goto VS2019Vars
>  if /I "%1"=="VS2017" goto VS2017Vars
>  if /I "%1"=="VS2015" goto VS2015Vars
>  if /I "%1"=="VS2013" goto VS2013Vars
>  if /I "%1"=="VS2012" goto VS2012Vars
> 
>  :set_vsvars
> -for /f "usebackq tokens=1* delims=: " %%i in (`%*`) do (
> -  if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
> -)
> +if defined VCINSTALLDIR goto :EOF
> +  call %* > vswhereInfo
> +  for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
> +    if /i "%%i"=="installationPath" (
> +      call "%%j\VC\Auxiliary\Build\vcvars32.bat"
> +    )
> +  )
> +  del vswhereInfo
>  goto :EOF
> 
>  :read_vsvars
> @@ -42,19 +48,36 @@ REM       (Or invoke the relevant vsvars32 file beforehand).
> 
>  :main
>  if defined VCINSTALLDIR goto :done
> +  :VS2019Vars
> +  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
> +    if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" (
> +      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products
> Microsoft.VisualStudio.Product.BuildTools -version 16,17
> +    ) else (
> +      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17
> +    )
> +  )
> +  if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
> +    if exist "%ProgramFiles%\Microsoft Visual Studio\2019\BuildTools" (
> +      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products
> Microsoft.VisualStudio.Product.BuildTools -version 16,17
> +    ) else (
> +      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17
> +    )
> +  )
> +  if /I "%1"=="VS2019" goto ToolNotInstall
> +
>    :VS2017Vars
>    if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
>      if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" (
> -      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products
> Microsoft.VisualStudio.Product.BuildTools
> +      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products
> Microsoft.VisualStudio.Product.BuildTools -version 15,16
>      ) else (
> -      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
> +      call :set_vsvars "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16
>      )
>    )
>    if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
>      if exist "%ProgramFiles%\Microsoft Visual Studio\2017\BuildTools" (
> -      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products
> Microsoft.VisualStudio.Product.BuildTools
> +      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products
> Microsoft.VisualStudio.Product.BuildTools -version 15,16
>      ) else (
> -      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
> +      call :set_vsvars "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16
>      )
>    )
>    if /I "%1"=="VS2017" goto ToolNotInstall
> diff --git a/BaseTools/set_vsprefix_envs.bat b/BaseTools/set_vsprefix_envs.bat
> index 81686f5b63..46b84713a6 100644
> --- a/BaseTools/set_vsprefix_envs.bat
> +++ b/BaseTools/set_vsprefix_envs.bat
> @@ -3,7 +3,7 @@
>  @REM   however it may be executed directly from the BaseTools project folder
>  @REM   if the file is not executed within a WORKSPACE\BaseTools folder.
>  @REM
> -@REM Copyright (c) 2016-2017, Intel Corporation. All rights reserved.<BR>
> +@REM Copyright (c) 2016-2019, Intel Corporation. All rights reserved.<BR>
>  @REM
>  @REM SPDX-License-Identifier: BSD-2-Clause-Patent
>  @REM
> @@ -18,6 +18,7 @@ set SCRIPT_ERROR=1
>  goto :EOF
> 
>  :main
> +if /I "%1"=="VS2019" goto SetVS2019
>  if /I "%1"=="VS2017" goto SetVS2017
>  if /I "%1"=="VS2015" goto SetVS2015
>  if /I "%1"=="VS2013" goto SetVS2013
> @@ -107,27 +108,86 @@ if defined VS140COMNTOOLS (
>  )
>  if /I "%1"=="VS2015" goto SetWinDDK
> 
> +:SetVS2019
> +if not defined VS160COMNTOOLS (
> +  if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
> +    if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" (
> +      call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools
> -version 16,17 > vswhereInfo
> +      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
> +        if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
> +      )
> +      del vswhereInfo
> +    ) else (
> +      call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17 > vswhereInfo
> +      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
> +        if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
> +      )
> +      del vswhereInfo
> +    )
> +  ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
> +    if exist "%ProgramFiles%\Microsoft Visual Studio\2019\BuildTools" (
> +      call "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version
> 16,17 > vswhereInfo
> +      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
> +        if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
> +      )
> +      del vswhereInfo
> +    ) else (
> +      call "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 16,17 > vswhereInfo
> +      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
> +        if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
> +      )
> +      del vswhereInfo
> +    )
> +  ) else (
> +    if /I "%1"=="VS2019" goto ToolNotInstall
> +    goto SetWinDDK
> +  )
> +)
> +
> +if defined VCToolsInstallDir (
> +  if not defined VS2019_PREFIX (
> +    set "VS2019_PREFIX=%VCToolsInstallDir%"
> +  )
> +)
> +if not defined WINSDK10_PREFIX (
> +  if defined WindowsSdkVerBinPath (
> +    set "WINSDK10_PREFIX=%WindowsSdkVerBinPath%"
> +  ) else if exist "%ProgramFiles(x86)%\Windows Kits\10\bin" (
> +    set "WINSDK10_PREFIX=%ProgramFiles(x86)%\Windows Kits\10\bin\"
> +  ) else if exist "%ProgramFiles%\Windows Kits\10\bin" (
> +    set "WINSDK10_PREFIX=%ProgramFiles%\Windows Kits\10\bin\"
> +  )
> +)
> +
>  :SetVS2017
>  if not defined VS150COMNTOOLS (
>    if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
>      if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\BuildTools" (
> -      for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products
> Microsoft.VisualStudio.Product.BuildTools`) do (
> +      call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools
> -version 15,16 > vswhereInfo
> +      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
>          if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
>        )
> +      del vswhereInfo
>      ) else (
> -      for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
> +      call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16 > vswhereInfo
> +      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
>          if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
>        )
> +      del vswhereInfo
>      )
>    ) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
>      if exist "%ProgramFiles%\Microsoft Visual Studio\2017\BuildTools" (
> -      for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products
> Microsoft.VisualStudio.Product.BuildTools`) do (
> +      call "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -version
> 15,16 > vswhereInfo
> +      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
>          if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
>        )
> +      del vswhereInfo
>      ) else (
> -      for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"`) do (
> +      call "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" -version 15,16 > vswhereInfo
> +      for /f "usebackq tokens=1* delims=: " %%i in (vswhereInfo) do (
>          if /i "%%i"=="installationPath" call "%%j\VC\Auxiliary\Build\vcvars32.bat"
>        )
> +      del vswhereInfo
>      )
>    ) else (
>      if /I "%1"=="VS2017" goto ToolNotInstall
> diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
> index 395694fa09..61ebf4ae09 100755
> --- a/BaseTools/toolsetup.bat
> +++ b/BaseTools/toolsetup.bat
> @@ -3,7 +3,7 @@
>  @REM   however it may be executed directly from the BaseTools project folder
>  @REM   if the file is not executed within a WORKSPACE\BaseTools folder.
>  @REM
> -@REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +@REM Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  @REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
>  @REM
>  @REM SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -42,6 +42,12 @@ if /I "%1"=="/?" goto Usage
>      set FORCE_REBUILD=TRUE
>      goto loop
>    )
> +  if /I "%1"=="VS2019" (
> +    shift
> +    set VS2019=TRUE
> +    set VSTool=VS2019
> +    goto loop
> +  )
>    if /I "%1"=="VS2017" (
>      shift
>      set VS2017=TRUE
> @@ -176,7 +182,9 @@ IF NOT exist "%EDK_TOOLS_PATH%\set_vsprefix_envs.bat" (
>    @echo.
>    goto end
>  )
> -if defined VS2017 (
> +if defined VS2019 (
> +  call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2019
> +) else if defined VS2017 (
>    call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2017
>  ) else if defined VS2015 (
>    call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat VS2015
> @@ -444,7 +452,7 @@ goto end
> 
>  :Usage
>    @echo.
> -  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]
> [VS2017] [VS2015] [VS2013] [VS2012]"
> +  echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]
> [VS2019] [VS2017] [VS2015] [VS2013] [VS2012]"
>    @echo.
>    @echo         base_tools_path   BaseTools project path, BASE_TOOLS_PATH will be set to this path.
>    @echo         edk_tools_path    EDK_TOOLS_PATH will be set to this path.
> @@ -457,12 +465,14 @@ goto end
>    @echo         VS2013            Set the env for VS2013 build.
>    @echo         VS2015            Set the env for VS2015 build.
>    @echo         VS2017            Set the env for VS2017 build.
> +  @echo         VS2019            Set the env for VS2019 build.
>    @echo.
> 
>  :end
>  set REBUILD=
>  set FORCE_REBUILD=
>  set RECONFIG=
> +set VS2019=
>  set VS2017=
>  set VS2015=
>  set VS2013=
> diff --git a/edksetup.bat b/edksetup.bat
> index 5f6028deff..024f57a4b7 100755
> --- a/edksetup.bat
> +++ b/edksetup.bat
> @@ -1,7 +1,7 @@
>  @REM @file
>  @REM   Windows batch file to setup a WORKSPACE environment
>  @REM
> -@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
> +@REM Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  @REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
>  @REM SPDX-License-Identifier: BSD-2-Clause-Patent
>  @REM
> @@ -133,6 +133,7 @@ if defined CYGWIN_HOME (
>  :cygwin_done
>  if /I "%1"=="Rebuild" shift
>  if /I "%1"=="ForceRebuild" shift
> +if /I "%1"=="VS2019" shift
>  if /I "%1"=="VS2017" shift
>  if /I "%1"=="VS2015" shift
>  if /I "%1"=="VS2013" shift
> @@ -141,7 +142,7 @@ if "%1"=="" goto end
> 
>  :Usage
>    @echo.
> -  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Rebuild] [ForceRebuild] [VS2017] [VS2015] [VS2013] [VS2012]"
> +  @echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [Reconfig] [Rebuild] [ForceRebuild] [VS2019] [VS2017] [VS2015] [VS2013]
> [VS2012]"
>    @echo.
>    @echo         Reconfig       Reinstall target.txt, tools_def.txt and build_rule.txt.
>    @echo         Rebuild        Perform incremental rebuild of BaseTools binaries.
> @@ -150,6 +151,7 @@ if "%1"=="" goto end
>    @echo         VS2013         Set the env for VS2013 build.
>    @echo         VS2015         Set the env for VS2015 build.
>    @echo         VS2017         Set the env for VS2017 build.
> +  @echo         VS2019         Set the env for VS2019 build.
>    @echo.
>    @echo  Note that target.template, tools_def.template and build_rules.template
>    @echo  will only be copied to target.txt, tools_def.txt and build_rule.txt
> --
> 2.21.0.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-09-16 15:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-11  6:08 [PATCH 0/2] *** Add VS2019 Support *** Cheng, Ching JenX
2019-09-11  6:08 ` [PATCH 1/2] Add VS2019 Toolchain def Cheng, Ching JenX
2019-09-11 15:43   ` [edk2-devel] " Pete Batard
2019-09-16  2:25     ` Cheng, Ching JenX
2019-09-16  9:47       ` Pete Batard
2019-09-11  6:08 ` [PATCH 2/2] Add VS2019 Support on ToolSetup Batches Cheng, Ching JenX
2019-09-16 15:52   ` Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox