summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/AutoGen.py
diff options
context:
space:
mode:
authorJiewen Yao <jiewen.yao@intel.com>2019-03-14 06:10:54 +0800
committerJiewen Yao <jiewen.yao@intel.com>2019-03-15 13:29:29 +0800
commitd868846a4ecc1f3ec28f68e05519960275138771 (patch)
tree1bd28afc81442ffd3f185f5d1fe86119757d6a00 /BaseTools/Source/Python/AutoGen/AutoGen.py
parentb2a0a4ffd4d601c2ceac74fc6c0921522fd653f7 (diff)
downloadedk2-d868846a4ecc1f3ec28f68e05519960275138771.tar.gz
edk2-d868846a4ecc1f3ec28f68e05519960275138771.tar.bz2
edk2-d868846a4ecc1f3ec28f68e05519960275138771.zip
BaseTool/Build: Add --disable-include-path-check.
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1620 This option is added to disable the include path check for outside of package. The original purpose of thie check is to make sure EDK II modules must not reference header files outside of the packages they depend on or within the module's directory tree. However, we do see the usage to build EDKII as executable running in the operating system which requires include path to outside. For example, EmulatorPkg. The current solution (soft link) is weird hack - EmulatorPkg\Unix\Host\X11IncludeHack. With this solution, this can be supported easily. The patch is validated with and without --disable-include-path-check. If user does not use --disable-include-path-check, the build will fail with outside path in the include path. If user uses --disable-include-path-check, the build will pass with outside path in the include path. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index e7dbf66e2f..568d535754 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3037,13 +3037,14 @@ class ModuleAutoGen(AutoGen):
# EDK II modules must not reference header files outside of the packages they depend on or
# within the module's directory tree. Report error if violation.
#
- for Path in IncPathList:
- if (Path not in self.IncludePathList) and (CommonPath([Path, self.MetaFile.Dir]) != self.MetaFile.Dir):
- ErrMsg = "The include directory for the EDK II module in this line is invalid %s specified in %s FLAGS '%s'" % (Path, Tool, FlagOption)
- EdkLogger.error("build",
- PARAMETER_INVALID,
- ExtraData=ErrMsg,
- File=str(self.MetaFile))
+ if GlobalData.gDisableIncludePathCheck == False:
+ for Path in IncPathList:
+ if (Path not in self.IncludePathList) and (CommonPath([Path, self.MetaFile.Dir]) != self.MetaFile.Dir):
+ ErrMsg = "The include directory for the EDK II module in this line is invalid %s specified in %s FLAGS '%s'" % (Path, Tool, FlagOption)
+ EdkLogger.error("build",
+ PARAMETER_INVALID,
+ ExtraData=ErrMsg,
+ File=str(self.MetaFile))
RetVal += IncPathList
return RetVal