Added pre-compiled header support for compiling source code
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 5 Sep 2006 03:16:09 +0000 (03:16 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 5 Sep 2006 03:16:09 +0000 (03:16 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1448 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Conf/BuildMacro.xml

index bad774ec4b22972e7e5585da3967637887a08cd9..0de9f321f3e376835ca227fe3bd709db1bdd7dae 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
 <!--\r
 Copyright (c) 2006, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -60,11 +60,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         </targetfiles>\r
 \r
         <sequential>\r
+          <!-- Use pre-compiled header if available -->\r
+          <if>\r
+            <and>\r
+              <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
+              <available file="${DEST_DIR_DEBUG}/AutoGen.pch"/>\r
+            </and>\r
+            <then>\r
+              <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yu${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_DEBUG}/AutoGen.pch"/>\r
+            </then>\r
+            <else>\r
+              <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>\r
+            </else>\r
+          </if>\r
+\r
           <cc userdefine="on">\r
             <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
               outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">\r
               <EXTRA.INC/>\r
-              <argument value="${CC_FLAGS}"/>\r
+              <argument value="${LOCAL_CC_FLAGS}"/>\r
               <EXTRA.ARG/>\r
               <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
             </command>\r
@@ -118,11 +132,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         </targetfiles>\r
 \r
         <sequential>\r
+          <!-- Generate pre-compiled header -->\r
+          <if>\r
+            <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
+            <then>\r
+              <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yc${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_DEBUG}/AutoGen.pch"/>\r
+            </then>\r
+            <else>\r
+              <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>\r
+            </else>\r
+          </if>\r
+\r
           <cc userdefine="on">\r
             <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
                 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">\r
               <EXTRA.INC/>\r
-              <argument value="${CC_FLAGS}"/>\r
+              <argument value="${LOCAL_CC_FLAGS}"/>\r
               <EXTRA.ARG/>\r
               <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
             </command>\r
@@ -575,11 +600,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         </targetfiles>\r
         \r
         <sequential>\r
+          <!-- Use pre-compiled header if available -->\r
+          <if>\r
+            <and>\r
+              <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
+              <available file="${DEST_DIR_DEBUG}/AutoGen.pch"/>\r
+            </and>\r
+            <then>\r
+              <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yc${DEST_DIR_DEBUG}/AutoGen.h /Yu${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_DEBUG}/AutoGen.pch"/>\r
+            </then>\r
+            <else>\r
+              <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>\r
+            </else>\r
+          </if>\r
+\r
           <cc userdefine="on">\r
             <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
                      includepathDelimiter="-I"\r
                      outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj">\r
-              <argument value="${CC_FLAGS}"/>\r
+              <argument value="${LOCAL_CC_FLAGS}"/>\r
               <EXTRA.INC />\r
               <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
             </command>\r
@@ -637,11 +676,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
             <EXTRA.INC/>\r
           </vfrcompile>\r
     \r
+          <!-- Use pre-compiled header if available -->\r
+          <if>\r
+            <and>\r
+              <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
+              <available file="${DEST_DIR_DEBUG}/AutoGen.pch"/>\r
+            </and>\r
+            <then>\r
+              <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yu${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_DEBUG}/AutoGen.pch"/>\r
+            </then>\r
+            <else>\r
+              <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>\r
+            </else>\r
+          </if>\r
+\r
           <cc userdefine="on">\r
             <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" \r
                      includepathDelimiter="-I" family="${CC_FAMILY}"\r
                      outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" >\r
-              <argument value="${CC_FLAGS}"/>\r
+              <argument value="${LOCAL_CC_FLAGS}"/>\r
               <EXTRA.INC/>\r
               <EXTRA.ARG/>\r
               <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>\r