Fix building error in Linux
[mirror_edk2.git] / Tools / CCode / Source / GenFvMap / build.xml
index 4d7e155..6d87631 100644 (file)
@@ -33,15 +33,28 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </target>\r
 \r
   <target name="Tool" depends="init">\r
+    <condition property="gxx_extra_libs" value="stdc++ System gcc_s.10.4 gcc">\r
+      <os family="mac"/>\r
+    </condition>\r
+    \r
+    <condition property="gxx_extra_libs" value="stdc++">\r
+      <os name="linux"/>\r
+    </condition>\r
+    \r
+    <condition property="gxx_extra_libs" value="stdc++">\r
+      <os family="windows"/>\r
+    </condition>\r
+  \r
     <cc name="${ToolChain}" objdir="${BUILD_DIR}"\r
         outfile="${BIN_DIR}/${ToolName}"\r
         outtype="executable"\r
         debug="true"\r
         optimize="speed">\r
       <compilerarg value="${ExtraArgus}" if="ExtraArgus" />\r
-      <compilerarg value="/EHsc" unless="GCC"/>\r
-      <compilerarg value="/Za" unless="GCC"/>\r
-\r
+      <compilerarg value="/EHsc" unless="gcc"/>\r
+      <compilerarg value="/Za" unless="gcc"/>\r
+      <compilerarg value="-x c++" if="gcc"/>\r
+      \r
       <fileset dir="${basedir}/${ToolName}"\r
         includes="${FileSet}"\r
         defaultexcludes="TRUE"\r
@@ -51,6 +64,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <includepath path="${PACKAGE_DIR}/Include/${HostArch}"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
+      <syslibset libs="${gxx_extra_libs}" if="gcc"/>\r
     </cc>\r
   </target>\r
 \r