@@ -115,7 +115,6 @@ int main(int argc, char** argv)
115115 std::vector<std::string> platformFilenames;
116116 std::string optimization;
117117 std::vector<std::string> genericPathStrings;
118- std::string outputFile=templateOutputFile;
119118 std::string intermediateDirectory;
120119 if (argc>1 )
121120 {
@@ -125,6 +124,7 @@ int main(int argc, char** argv)
125124 int a=0 ;
126125 for (int i=1 ;i<argc;i++)
127126 {
127+ std::cout << " argv[" << i << " ] " << argv[i] << std::endl;
128128 while (argv[i][0 ]==' ' )
129129 argv[i]++;
130130 if (strlen (argv[i])>=2 &&(argv[i][0 ]==' -' ))
@@ -159,7 +159,9 @@ int main(int argc, char** argv)
159159 platformFilenames.push_back (std::filesystem::weakly_canonical (StripQuotes (arg)).generic_string ());
160160 }
161161 else if (argtype == ' o' || argtype == ' O' )
162+ {
162163 templateOutputFile = StripQuotes (arg);
164+ }
163165 else if (argtype == ' d' || argtype == ' D' )
164166 {
165167 sfxOptions.debugInfo = true ;
@@ -193,6 +195,7 @@ int main(int argc, char** argv)
193195 paths[n]=0 ;
194196 args[a]=0 ;
195197 }
198+ std::string outputFile=templateOutputFile;
196199 for (auto e : environment)
197200 {
198201 SetEnv (e.first , e.second );
@@ -239,7 +242,6 @@ int main(int argc, char** argv)
239242 break ;
240243 }
241244 }
242- std::cout << std::setw (4 )<< " info: building " <<sourceName<<" for " <<platformName<<" ." << std::endl;
243245 SetEnv (" PLATFORM_DIR" ,platform_dir.c_str ());
244246 std::cout<<" \n " <<GetEnv (" BUILD_DIR" )<<std::endl;
245247 auto pathStrings=genericPathStrings;
@@ -320,7 +322,6 @@ int main(int argc, char** argv)
320322 pathStrings.push_back (ProcessPath (ProcessEnvironmentVariables (b)));
321323 }
322324 }
323- outputFile=templateOutputFile;
324325 if (outputFile.length ()==0 )
325326 {
326327 if (j.count (" outputPath" )>0 )
@@ -329,15 +330,15 @@ int main(int argc, char** argv)
329330 }
330331 else
331332 {
332- outputFile = " $BUILD_DIR/Shaders/" + platformName+ " /shaderbin" s;
333+ outputFile = " $BUILD_DIR/Shaders/" + platformName + " /shaderbin" s;
333334 }
334335 }
335- outputFile= ProcessEnvironmentVariables (outputFile);
336- if (intermediateDirectory.length ()== 0 )
336+ outputFile = ProcessEnvironmentVariables (outputFile);
337+ if (intermediateDirectory.length () == 0 )
337338 {
338- if (j.count (" intermediateDirectory" )> 0 )
339+ if (j.count (" intermediateDirectory" ) > 0 )
339340 {
340- sfxOptions.intermediateDirectory = ProcessEnvironmentVariables (j[" intermediateDirectory" ]);
341+ sfxOptions.intermediateDirectory = ProcessEnvironmentVariables (j[" intermediateDirectory" ]);
341342 }
342343 else
343344 {
@@ -597,9 +598,8 @@ int main(int argc, char** argv)
597598 }
598599 // write a summary output file, so we have a single output with the build time on it.
599600 SetEnv (" PLATFORM_NAME" ," " );
600- templateOutputFile=ProcessEnvironmentVariables (templateOutputFile);
601601 sourceName = sourceName.replace (sourceName.rfind (" ." ), sourceName.length (), " " );
602- std::string summaryFilename=templateOutputFile+" /" s+sourceName+" .sfx_summary" ;
602+ std::string summaryFilename=ProcessEnvironmentVariables ( templateOutputFile) +" /" s+sourceName+" .sfx_summary" ;
603603 if (ret==0 )
604604 {
605605 std::ofstream summary (summaryFilename);
0 commit comments