From 603cd2ab6a1d840943193e626dd992203a46e6ba Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 2 Jan 2008 09:32:29 -0500 Subject: ENH: fix new incremental link stuff to work with nmake @ files --- Source/cmake.cxx | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 099a053..010e162 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -3674,17 +3674,45 @@ int cmake::VisualStudioLink(std::vector& args, int type) { verbose = true; } - // figure out if this is an incremental link or not and run the correct - // link function. + std::vector expandedArgs; for(std::vector::iterator i = args.begin(); i != args.end(); ++i) { + // check for nmake temporary files + if((*i)[0] == '@') + { + std::ifstream fin(i->substr(1).c_str()); + std::string line; + while(cmSystemTools::GetLineFromStream(fin, + line)) + { + cmSystemTools::ParseWindowsCommandLine(line.c_str(), expandedArgs); + } + } + else + { + expandedArgs.push_back(*i); + } + } + // figure out if this is an incremental link or not and run the correct + // link function. + for(std::vector::iterator i = expandedArgs.begin(); + i != expandedArgs.end(); ++i) + { if(cmSystemTools::Strucmp(i->c_str(), "/INCREMENTAL:YES") == 0) { - return cmake::VisualStudioLinkIncremental(args, type, verbose); + if(verbose) + { + std::cout << "Visual Studio Incremental Link\n"; + } + return cmake::VisualStudioLinkIncremental(expandedArgs, type, verbose); } } - return cmake::VisualStudioLinkNonIncremental(args, type, verbose); + if(verbose) + { + std::cout << "Visual Studio Non-Incremental Link\n"; + } + return cmake::VisualStudioLinkNonIncremental(expandedArgs, type, verbose); } int cmake::ParseVisualStudioLinkCommand(std::vector& args, -- cgit v0.12