浏览代码

FIX: command now expands *all* args (found through FOREACH example)

Sebastien Barre 24 年之前
父节点
当前提交
b253a0644d
共有 1 个文件被更改,包括 10 次插入5 次删除
  1. 10 5
      Source/cmAddExecutableCommand.cxx

+ 10 - 5
Source/cmAddExecutableCommand.cxx

@@ -32,17 +32,22 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
   m_Makefile->ExpandVariablesInString(exename);
   m_Makefile->ExpandVariablesInString(exename);
 
 
   ++s;
   ++s;
+  bool use_win32 = false;
+
   if (*s == "WIN32")
   if (*s == "WIN32")
     {
     {
     ++s;
     ++s;
-    std::vector<std::string> srclists(s, args.end());
-    m_Makefile->AddExecutable(exename.c_str(),srclists, true); 
+    use_win32 = true;
     }
     }
-  else
+
+  std::vector<std::string> srclists(s, args.end());
+  for(std::vector<std::string>::iterator j = srclists.begin();
+      j != srclists.end(); ++j)
     {
     {
-    std::vector<std::string> srclists(s, args.end());
-    m_Makefile->AddExecutable(exename.c_str(),srclists, false); 
+    m_Makefile->ExpandVariablesInString(*j);
     }
     }
+
+  m_Makefile->AddExecutable(exename.c_str(), srclists, use_win32); 
   
   
   return true;
   return true;
 }
 }