diff options
| author | Michael D Kinney <michael.d.kinney@intel.com> | 2025-12-26 21:57:44 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-01-06 07:44:08 +0300 |
| commit | a0002ddc5342c7bb34fb3a0bb87c1235c8d8821d (patch) | |
| tree | ff8f754ce16947e1abe2522a6954d12dc493c77e /BaseTools/Source/Python | |
| parent | 185e424602002e30c1d6c1ad21892d1af0c162a8 (diff) | |
| download | edk2-a0002ddc5342c7bb34fb3a0bb87c1235c8d8821d.tar.xz | |
BaseTools/build: Add defines for Windows build environments
The stuart tools automatically add -D WIN_HOST_BUILD to
edk2 build command line if a Windows build environment
is detected. This behavior is added to build.py so that
builds of the EmulatorPkg using build.py are not required
to add the option -D WIN_HOST_BUILD when building in a
Windows environment. This aligns Linux and Windows builds
of the EmulatorPkg removing the need to specify extra
defines.
In order to build the EmulatorPkg for Windows Mingw
environments, EmulatorPkg DSC/FDF files require a way
to detect if Windows Mingw environment is present.
The Windows Mingw environment can be detected if
CLANG_BIN is set and mingw32-make.exe is detected
in the CLANG_BIN directory.
If a Windows Mingw environment is detected, add
-D WIN_MINGW32_BUILD to the edk2 build command line.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'BaseTools/Source/Python')
| -rwxr-xr-x | BaseTools/Source/Python/build/build.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index d403851d51..6b6b60e9bf 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -2627,6 +2627,11 @@ def Main(): if platform.platform().find("Windows") >= 0:
GlobalData.gIsWindows = True
+ GlobalData.gCommandLineDefines['WIN_HOST_BUILD'] = 'TRUE'
+ clang_bin = os.getenv("CLANG_BIN")
+ if clang_bin:
+ if os.path.exists(os.path.join(clang_bin, "mingw32-make.exe")):
+ GlobalData.gCommandLineDefines['WIN_MINGW32_BUILD'] = 'TRUE'
else:
GlobalData.gIsWindows = False
|
