summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2025-06-24 21:55:32 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-06-25 21:40:50 +0000
commita2e4ee7ed26a28dcdcf0c0091f5ee44c8ea2cfbe (patch)
tree6db37c27ef11682c00ede34265f6514329d98df6
parentd7110cd638c00f2d5697783630c82cbffe63823d (diff)
downloadedk2-a2e4ee7ed26a28dcdcf0c0091f5ee44c8ea2cfbe.zip
edk2-a2e4ee7ed26a28dcdcf0c0091f5ee44c8ea2cfbe.tar.gz
edk2-a2e4ee7ed26a28dcdcf0c0091f5ee44c8ea2cfbe.tar.bz2
UnitTestFrameworkPkg: Add -Wno-write-strings to host unit tests
Disable write strings warning for host-based unit test builds when building modules of type HOST_APPLICATION. Modules of type HOST_APPLICATION may compile and link code under test into the host-based unit test. When building GoogleTest based unit tests, the G++ compiler is used. The G++ compiler is stricter than GCC for passing a const string into a function parameter that is not const. This is not a warning for GCC build of firmware code. But GoogleTest builds that use g++ detect as a warning and that breaks the build. The firmware code under test can not be changed, so the warning -Wno-write-strings is added to CC_FLAGS to ignore this warning. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
-rw-r--r--UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc1
1 files changed, 1 insertions, 0 deletions
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index e257ce5..0f68516 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -71,6 +71,7 @@
#
# GCC
#
+ GCC:*_*_*_CC_FLAGS = -Wno-write-strings
GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m32 -no-pie
GCC:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m64 -no-pie
#