summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2024-02-02 17:04:33 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-02-14 02:37:16 +0000
commit46c6de57b0628567ed3e72a7c65d1e6c708312cc (patch)
tree70aa08ef9ccf68348477a32d49c42cf319912aeb
parentded41a64bd5c6bc40283bf5bd07b18bae5cbcd09 (diff)
downloadedk2-46c6de57b0628567ed3e72a7c65d1e6c708312cc.tar.gz
edk2-46c6de57b0628567ed3e72a7c65d1e6c708312cc.tar.bz2
edk2-46c6de57b0628567ed3e72a7c65d1e6c708312cc.zip
UnitTestFrameworkPkg: MSFT CC_FLAGS add /MT to for host builds
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4683 Add /MT to MSFT CC_FLAGS to always use release libraries when building host-based unit tests so any exceptions generated during host-based test execution generate an error message in stderr instead of a popup window. Use /MTd when -D UNIT_TESTING_DEBUG is to use debug libraries when building host-based unit tests so any exceptions generated during host-based test execution generate a popup window with option to attach a debugger. Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
-rw-r--r--UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf2
-rw-r--r--UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc3
2 files changed, 3 insertions, 2 deletions
diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
index 0104384953..83ab9f9b2a 100644
--- a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
+++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
@@ -28,6 +28,6 @@
UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
[BuildOptions]
- MSFT:*_*_*_CC_FLAGS == /c /EHsc /Zi /Od
+ MSFT:*_*_*_CC_FLAGS == /c /EHsc /Zi /Od /MT
GCC:*_*_IA32_CC_FLAGS == -g -c -fshort-wchar -O0 -m32
GCC:*_*_X64_CC_FLAGS == -g -c -fshort-wchar -O0 -m64
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index b8068fd91c..00f8d9a895 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -24,9 +24,10 @@
PeiServicesTablePointerLib|UnitTestFrameworkPkg/Library/UnitTestPeiServicesTablePointerLib/UnitTestPeiServicesTablePointerLib.inf
[BuildOptions]
+ MSFT:*_*_*_CC_FLAGS = /MT
GCC:*_*_*_CC_FLAGS = -fno-pie
!ifdef $(UNIT_TESTING_DEBUG)
- MSFT:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
+ MSFT:*_*_*_CC_FLAGS = /MTd -D UNIT_TESTING_DEBUG=1
GCC:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
XCODE:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
!endif