summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/C/VfrCompile/VfrCompiler.cpp')
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrCompiler.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
index 195727c2eb..e3c150cd3d 100644
--- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
@@ -628,23 +628,27 @@ CVfrCompiler::GenCFile (
if (!IS_RUN_STATUS(STATUS_GENBINARY)) {
goto Fail;
}
+
+ if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) {
+ if ((pFile = fopen (mOptions.COutputFileName, "w")) == NULL) {
+ Error (NULL, 0, 0001, "Error opening output C file", mOptions.COutputFileName);
+ goto Fail;
+ }
- if ((pFile = fopen (mOptions.COutputFileName, "w")) == NULL) {
- Error (NULL, 0, 0001, "Error opening output C file", mOptions.COutputFileName);
- goto Fail;
- }
-
- for (Index = 0; gSourceFileHeader[Index] != NULL; Index++) {
- fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
- }
+ for (Index = 0; gSourceFileHeader[Index] != NULL; Index++) {
+ fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
+ }
- gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
+ if (mOptions.CompatibleMode) {
+ gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
+ }
- if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) != VFR_RETURN_SUCCESS) {
+ if (gCFormPkg.GenCFile (mOptions.VfrBaseFileName, pFile, &gRBuffer) != VFR_RETURN_SUCCESS) {
+ fclose (pFile);
+ goto Fail;
+ }
fclose (pFile);
- goto Fail;
}
- fclose (pFile);
SET_RUN_STATUS (STATUS_FINISHED);
return;