2010-11-23 11:47:52 +00:00
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers , whose names
* are too numerous to list here . Please refer to the COPYRIGHT
* file distributed with this source distribution .
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
*
*/
# include "visualstudio.h"
2020-07-14 09:34:04 +02:00
# include "config.h"
2010-11-23 11:47:52 +00:00
# include <algorithm>
2020-07-14 09:34:04 +02:00
# include <fstream>
2010-11-23 11:47:52 +00:00
namespace CreateProjectTool {
//////////////////////////////////////////////////////////////////////////
2014-06-19 18:21:14 -07:00
// Visual Studio Provider (Visual Studio 2008)
2010-11-23 11:47:52 +00:00
//////////////////////////////////////////////////////////////////////////
2020-07-14 09:34:04 +02:00
VisualStudioProvider : : VisualStudioProvider ( StringList & global_warnings , std : : map < std : : string , StringList > & project_warnings , const int version , const MSVCVersion & msvc )
: MSVCProvider ( global_warnings , project_warnings , version , msvc ) {
2020-07-13 06:30:06 +01:00
_archs . push_back ( ARCH_X86 ) ;
_archs . push_back ( ARCH_AMD64 ) ;
2010-11-23 11:47:52 +00:00
}
const char * VisualStudioProvider : : getProjectExtension ( ) {
return " .vcproj " ;
}
const char * VisualStudioProvider : : getPropertiesExtension ( ) {
return " .vsprops " ;
}
void VisualStudioProvider : : createProjectFile ( const std : : string & name , const std : : string & uuid , const BuildSetup & setup , const std : : string & moduleDir ,
const StringList & includeList , const StringList & excludeList ) {
const std : : string projectFile = setup . outputDir + ' / ' + name + getProjectExtension ( ) ;
std : : ofstream project ( projectFile . c_str ( ) ) ;
2020-07-13 12:04:42 +02:00
if ( ! project | | ! project . is_open ( ) ) {
2010-11-23 11:47:52 +00:00
error ( " Could not open \" " + projectFile + " \" for writing " ) ;
2020-07-13 12:04:42 +02:00
return ;
}
2010-11-23 11:47:52 +00:00
project < < " <?xml version= \" 1.0 \" encoding= \" windows-1252 \" ?> \n "
2020-07-14 09:34:04 +02:00
< < " <VisualStudioProject \n "
< < " \t ProjectType= \" Visual C++ \" \n "
< < " \t Version= \" " < < _version < < " .00 \" \n "
< < " \t Name= \" " < < name < < " \" \n "
< < " \t ProjectGUID= \" { " < < uuid < < " } \" \n "
< < " \t RootNamespace= \" " < < name < < " \" \n "
< < " \t Keyword= \" Win32Proj \" \n " ;
2010-11-23 11:47:52 +00:00
2014-06-19 18:21:14 -07:00
project < < " \t TargetFrameworkVersion= \" 131072 \" \n " ;
2010-11-23 11:47:52 +00:00
project < < " \t > \n "
2020-07-13 06:30:06 +01:00
" \t <Platforms> \n " ;
for ( std : : list < MSVC_Architecture > : : const_iterator arch = _archs . begin ( ) ; arch ! = _archs . end ( ) ; + + arch ) {
project < < " \t \t <Platform Name= \" " < < getMSVCConfigName ( * arch ) < < " \" /> \n " ;
}
project < < " \t </Platforms> \n "
2020-07-14 09:34:04 +02:00
< < " \t <Configurations> \n " ;
2010-11-23 11:47:52 +00:00
// Check for project-specific warnings:
2020-07-14 09:34:04 +02:00
std : : map < std : : string , std : : list < std : : string > > : : iterator warningsIterator = _projectWarnings . find ( name ) ;
2010-11-23 11:47:52 +00:00
2013-07-07 11:23:19 -04:00
if ( setup . devTools | | setup . tests | | name = = setup . projectName ) {
2010-11-23 11:47:52 +00:00
std : : string libraries ;
for ( StringList : : const_iterator i = setup . libraries . begin ( ) ; i ! = setup . libraries . end ( ) ; + + i )
libraries + = ' ' + * i + " .lib " ;
// For 'x64' we must disable NASM support. Usually we would need to disable the "nasm" feature for that and
// re-create the library list, BUT since NASM doesn't link any additional libraries, we can just use the
// libraries list created for IA-32. If that changes in the future, we need to adjust this part!
2020-07-13 06:30:06 +01:00
for ( std : : list < MSVC_Architecture > : : const_iterator arch = _archs . begin ( ) ; arch ! = _archs . end ( ) ; + + arch ) {
outputConfiguration ( project , setup , libraries , " Debug " , * arch ) ;
outputConfiguration ( project , setup , libraries , " Analysis " , * arch ) ;
outputConfiguration ( project , setup , libraries , " LLVM " , * arch ) ;
outputConfiguration ( project , setup , libraries , " Release " , * arch ) ;
}
2010-11-23 11:47:52 +00:00
} else {
2012-09-05 07:54:33 -04:00
bool enableLanguageExtensions = find ( _enableLanguageExtensions . begin ( ) , _enableLanguageExtensions . end ( ) , name ) ! = _enableLanguageExtensions . end ( ) ;
bool disableEditAndContinue = find ( _disableEditAndContinue . begin ( ) , _disableEditAndContinue . end ( ) , name ) ! = _disableEditAndContinue . end ( ) ;
2010-11-23 11:47:52 +00:00
std : : string warnings = " " ;
if ( warningsIterator ! = _projectWarnings . end ( ) )
for ( StringList : : const_iterator i = warningsIterator - > second . begin ( ) ; i ! = warningsIterator - > second . end ( ) ; + + i )
2020-07-14 09:34:04 +02:00
warnings + = * i + ' ; ' ;
2010-11-23 11:47:52 +00:00
std : : string toolConfig ;
2020-07-14 09:34:04 +02:00
toolConfig = ( ! warnings . empty ( ) ? " DisableSpecificWarnings= \" " + warnings + " \" " : " " ) ;
toolConfig + = ( disableEditAndContinue ? " DebugInformationFormat= \" 3 \" " : " " ) ;
2012-09-05 07:54:33 -04:00
toolConfig + = ( enableLanguageExtensions ? " DisableLanguageExtensions= \" false \" " : " " ) ;
2010-11-23 11:47:52 +00:00
2020-07-13 06:30:06 +01:00
for ( std : : list < MSVC_Architecture > : : const_iterator arch = _archs . begin ( ) ; arch ! = _archs . end ( ) ; + + arch ) {
2020-07-14 05:55:35 +01:00
outputConfiguration ( setup , project , toolConfig , " Debug " , * arch ) ;
outputConfiguration ( setup , project , toolConfig , " Analysis " , * arch ) ;
outputConfiguration ( setup , project , toolConfig , " LLVM " , * arch ) ;
outputConfiguration ( setup , project , toolConfig , " Release " , * arch ) ;
2020-07-13 06:30:06 +01:00
}
2010-11-23 11:47:52 +00:00
}
project < < " \t </Configurations> \n "
2020-07-14 09:34:04 +02:00
< < " \t <Files> \n " ;
2010-11-23 11:47:52 +00:00
std : : string modulePath ;
if ( ! moduleDir . compare ( 0 , setup . srcDir . size ( ) , setup . srcDir ) ) {
modulePath = moduleDir . substr ( setup . srcDir . size ( ) ) ;
if ( ! modulePath . empty ( ) & & modulePath . at ( 0 ) = = ' / ' )
modulePath . erase ( 0 , 1 ) ;
}
if ( modulePath . size ( ) )
addFilesToProject ( moduleDir , project , includeList , excludeList , setup . filePrefix + ' / ' + modulePath ) ;
else
addFilesToProject ( moduleDir , project , includeList , excludeList , setup . filePrefix ) ;
2013-07-07 11:23:19 -04:00
// Output auto-generated test runner
if ( setup . tests ) {
project < < " \t \t <File RelativePath= \" test_runner.cpp \" /> \n " ;
}
2010-11-23 11:47:52 +00:00
project < < " \t </Files> \n "
2020-07-14 09:34:04 +02:00
< < " </VisualStudioProject> \n " ;
2010-11-23 11:47:52 +00:00
}
2020-05-08 13:17:36 -07:00
void VisualStudioProvider : : outputConfiguration ( std : : ostream & project , const BuildSetup & setup , const std : : string & libraries , const std : : string & config , const MSVC_Architecture arch ) {
project < < " \t \t <Configuration Name= \" " < < config < < " | " < < getMSVCConfigName ( arch ) < < " \" ConfigurationType= \" 1 \" InheritedPropertySheets= \" . \\ " < < setup . projectDescription < < " _ " < < config < < getMSVCArchName ( arch ) < < " .vsprops \" > \n "
2020-07-14 09:34:04 +02:00
< < " \t \t \t <Tool \t Name= \" VCCLCompilerTool \" DisableLanguageExtensions= \" false \" DebugInformationFormat= \" 3 \" /> \n "
< < " \t \t \t <Tool \t Name= \" VCLinkerTool \" OutputFile= \" $(OutDir)/ " < < setup . projectName < < " .exe \" \n "
< < " \t \t \t \t AdditionalDependencies= \" " < < libraries < < " \" \n "
< < " \t \t \t /> \n " ;
2020-05-08 13:17:36 -07:00
outputBuildEvents ( project , setup , arch ) ;
2011-04-28 17:44:17 +02:00
project < < " \t \t </Configuration> \n " ;
}
2020-07-14 05:55:35 +01:00
void VisualStudioProvider : : outputConfiguration ( const BuildSetup & setup , std : : ostream & project , const std : : string & toolConfig , const std : : string & config , const MSVC_Architecture arch ) {
project < < " \t \t <Configuration Name= \" " < < config < < " | " < < getMSVCConfigName ( arch ) < < " \" ConfigurationType= \" 4 \" InheritedPropertySheets= \" . \\ " < < setup . projectDescription < < " _ " < < config < < getMSVCArchName ( arch ) < < " .vsprops \" > \n "
2020-07-14 09:34:04 +02:00
< < " \t \t \t <Tool Name= \" VCCLCompilerTool \" " < < toolConfig < < " /> \n "
< < " \t \t </Configuration> \n " ;
2011-04-28 17:44:17 +02:00
}
2020-05-08 13:17:36 -07:00
void VisualStudioProvider : : outputBuildEvents ( std : : ostream & project , const BuildSetup & setup , const MSVC_Architecture arch ) {
2013-07-07 11:23:19 -04:00
if ( ! setup . devTools & & ! setup . tests & & setup . runBuildEvents ) {
2011-04-28 17:44:17 +02:00
project < < " \t \t \t <Tool \t Name= \" VCPreBuildEventTool \" \n "
2020-07-14 09:34:04 +02:00
< < " \t \t \t \t CommandLine= \" " < < getPreBuildEvent ( ) < < " \" \n "
< < " \t \t \t /> \n "
< < " \t \t \t <Tool \t Name= \" VCPostBuildEventTool \" \n "
< < " \t \t \t \t CommandLine= \" " < < getPostBuildEvent ( arch , setup ) < < " \" \n "
< < " \t \t \t /> \n " ;
2011-04-28 17:44:17 +02:00
}
2013-07-07 11:23:19 -04:00
// Generate runner file before build for tests
if ( setup . tests ) {
project < < " \t \t \t <Tool \t Name= \" VCPreBuildEventTool \" \n "
2020-07-14 09:34:04 +02:00
< < " \t \t \t \t CommandLine= \" " < < getTestPreBuildEvent ( setup ) < < " \" \n "
< < " \t \t \t /> \n " ;
2013-07-07 11:23:19 -04:00
project < < " \t \t \t <Tool \t Name= \" VCPostBuildEventTool \" \n "
2020-07-14 09:34:04 +02:00
< < " \t \t \t \t CommandLine= \" $(TargetPath) \" IgnoreExitCode= \" true \" \n "
< < " \t \t \t /> \n " ;
2013-07-07 11:23:19 -04:00
}
2011-04-28 17:44:17 +02:00
}
2011-09-06 16:01:10 -04:00
void VisualStudioProvider : : writeReferences ( const BuildSetup & setup , std : : ofstream & output ) {
2010-11-23 11:47:52 +00:00
output < < " \t ProjectSection(ProjectDependencies) = postProject \n " ;
for ( UUIDMap : : const_iterator i = _uuidMap . begin ( ) ; i ! = _uuidMap . end ( ) ; + + i ) {
2011-09-06 16:01:10 -04:00
if ( i - > first = = setup . projectName )
2010-11-23 11:47:52 +00:00
continue ;
output < < " \t \t { " < < i - > second < < " } = { " < < i - > second < < " } \n " ;
}
output < < " \t EndProjectSection \n " ;
}
2020-05-08 13:17:36 -07:00
void VisualStudioProvider : : outputGlobalPropFile ( const BuildSetup & setup , std : : ofstream & properties , MSVC_Architecture arch , const StringList & defines , const std : : string & prefix , bool runBuildEvents ) {
2010-11-23 11:47:52 +00:00
std : : string warnings ;
for ( StringList : : const_iterator i = _globalWarnings . begin ( ) ; i ! = _globalWarnings . end ( ) ; + + i )
2020-07-14 09:34:04 +02:00
warnings + = * i + ' ; ' ;
2010-11-23 11:47:52 +00:00
std : : string definesList ;
for ( StringList : : const_iterator i = defines . begin ( ) ; i ! = defines . end ( ) ; + + i ) {
if ( i ! = defines . begin ( ) )
definesList + = ' ; ' ;
definesList + = * i ;
}
2011-04-24 12:34:57 -04:00
// Add define to include revision header
if ( runBuildEvents )
2011-04-24 13:33:23 -04:00
definesList + = REVISION_DEFINE " ; " ;
2011-04-24 12:34:57 -04:00
2010-11-23 11:47:52 +00:00
properties < < " <?xml version= \" 1.0 \" encoding= \" Windows-1252 \" ?> \n "
2020-07-14 09:34:04 +02:00
< < " <VisualStudioPropertySheet \n "
< < " \t ProjectType= \" Visual C++ \" \n "
< < " \t Version= \" 8.00 \" \n "
< < " \t Name= \" " < < setup . projectDescription < < " _Global \" \n "
< < " \t OutputDirectory= \" $(ConfigurationName) " < < getMSVCArchName ( arch ) < < " \" \n "
< < " \t IntermediateDirectory= \" $(ConfigurationName) " < < getMSVCArchName ( arch ) < < " /$(ProjectName) \" \n "
< < " \t > \n "
< < " \t <Tool \n "
< < " \t \t Name= \" VCCLCompilerTool \" \n "
< < " \t \t DisableLanguageExtensions= \" " < < ( setup . devTools ? " false " : " true " ) < < " \" \n "
< < " \t \t DisableSpecificWarnings= \" " < < warnings < < " \" \n "
< < " \t \t AdditionalIncludeDirectories= \" . \\ ; " < < prefix < < " ; " < < prefix < < " \\ engines;$( " < < LIBS_DEFINE < < " ) \\ include;$( " < < LIBS_DEFINE < < " ) \\ include \\ SDL; " < < ( setup . tests ? prefix + " \\ test \\ cxxtest; " : " " ) < < " \" \n "
< < " \t \t PreprocessorDefinitions= \" " < < definesList < < " \" \n "
< < " \t \t ExceptionHandling= \" " < < ( ( setup . devTools | | setup . tests | | _version = = 14 ) ? " 1 " : " 0 " ) < < " \" \n " ;
2011-04-24 13:33:23 -04:00
# if NEEDS_RTTI
properties < < " \t \t RuntimeTypeInfo= \" true \" \n " ;
# else
properties < < " \t \t RuntimeTypeInfo= \" false \" \n " ;
# endif
2011-05-06 19:39:12 +10:00
properties < < " \t \t WarningLevel= \" 4 \" \n "
2020-07-14 09:34:04 +02:00
< < " \t \t WarnAsError= \" false \" \n "
< < " \t \t CompileAs= \" 0 \" \n "
< < " \t \t /> \n "
< < " \t <Tool \n "
< < " \t \t Name= \" VCLibrarianTool \" \n "
< < " \t \t IgnoreDefaultLibraryNames= \" \" \n "
< < " \t /> \n "
< < " \t <Tool \n "
< < " \t \t Name= \" VCLinkerTool \" \n "
< < " \t \t IgnoreDefaultLibraryNames= \" \" \n "
< < " \t \t SubSystem= \" 1 \" \n " ;
2011-09-06 16:01:10 -04:00
2013-07-07 11:23:19 -04:00
if ( ! setup . devTools & & ! setup . tests )
2011-09-06 16:01:10 -04:00
properties < < " \t \t EntryPointSymbol= \" WinMainCRTStartup \" \n " ;
2020-05-08 13:17:36 -07:00
properties < < " \t \t AdditionalLibraryDirectories= \" $( " < < LIBS_DEFINE < < " ) \\ lib \\ " < < getMSVCArchName ( arch ) < < " \" \n "
2020-07-14 09:34:04 +02:00
< < " \t /> \n "
< < " \t <Tool \n "
< < " \t \t Name= \" VCResourceCompilerTool \" \n "
< < " \t \t AdditionalIncludeDirectories= \" . \\ ; " < < prefix < < " \" \n "
< < " \t \t PreprocessorDefinitions= \" " < < definesList < < " \" \n "
< < " \t /> \n "
< < " </VisualStudioPropertySheet> \n " ;
2010-11-23 11:47:52 +00:00
properties . flush ( ) ;
}
2020-05-08 13:17:36 -07:00
void VisualStudioProvider : : createBuildProp ( const BuildSetup & setup , bool isRelease , MSVC_Architecture arch , const std : : string & configuration ) {
2010-11-23 11:47:52 +00:00
2020-07-14 05:55:35 +01:00
std : : ofstream properties ( ( setup . outputDir + ' / ' + setup . projectDescription + " _ " + configuration + getMSVCArchName ( arch ) + getPropertiesExtension ( ) ) . c_str ( ) ) ;
2020-07-13 12:04:42 +02:00
if ( ! properties | | ! properties . is_open ( ) ) {
2020-07-14 05:55:35 +01:00
error ( " Could not open \" " + setup . outputDir + ' / ' + setup . projectDescription + " _ " + configuration + getMSVCArchName ( arch ) + getPropertiesExtension ( ) + " \" for writing " ) ;
2020-07-13 12:04:42 +02:00
return ;
}
2010-11-23 11:47:52 +00:00
properties < < " <?xml version= \" 1.0 \" encoding= \" Windows-1252 \" ?> \n "
2020-07-14 09:34:04 +02:00
< < " <VisualStudioPropertySheet \n "
< < " \t ProjectType= \" Visual C++ \" \n "
< < " \t Version= \" 8.00 \" \n "
< < " \t Name= \" " < < setup . projectDescription < < " _ " < < configuration < < getMSVCArchName ( arch ) < < " \" \n "
< < " \t InheritedPropertySheets= \" . \\ " < < setup . projectDescription < < " _Global " < < getMSVCArchName ( arch ) < < " .vsprops \" \n "
< < " \t > \n "
< < " \t <Tool \n "
< < " \t \t Name= \" VCCLCompilerTool \" \n " ;
2010-11-23 11:47:52 +00:00
if ( isRelease ) {
properties < < " \t \t EnableIntrinsicFunctions= \" true \" \n "
2020-07-14 09:34:04 +02:00
< < " \t \t WholeProgramOptimization= \" true \" \n "
< < " \t \t PreprocessorDefinitions= \" WIN32;RELEASE_BUILD \" \n "
< < " \t \t StringPooling= \" true \" \n "
< < " \t \t BufferSecurityCheck= \" false \" \n "
< < " \t \t DebugInformationFormat= \" 0 \" \n "
< < " \t \t RuntimeLibrary= \" 0 \" \n "
< < " \t \t AdditionalOption= \" " < < ( configuration = = " Analysis " ? " /analyze " : " " ) < < " \" \n "
< < " \t /> \n "
< < " \t <Tool \n "
< < " \t \t Name= \" VCLinkerTool \" \n "
< < " \t \t LinkIncremental= \" 1 \" \n "
< < " \t \t GenerateManifest= \" false \" \n "
< < " \t \t IgnoreDefaultLibraryNames= \" \" \n "
< < " \t \t SetChecksum= \" true \" \n " ;
2010-11-23 11:47:52 +00:00
} else {
properties < < " \t \t Optimization= \" 0 \" \n "
2020-07-14 09:34:04 +02:00
< < " \t \t PreprocessorDefinitions= \" WIN32 \" \n "
< < " \t \t MinimalRebuild= \" true \" \n "
< < " \t \t BasicRuntimeChecks= \" 3 \" \n "
< < " \t \t RuntimeLibrary= \" 1 \" \n "
< < " \t \t EnableFunctionLevelLinking= \" true \" \n "
< < " \t \t WarnAsError= \" false \" \n "
< < " \t \t DebugInformationFormat= \" " < < ( arch = = ARCH_X86 ? " 3 " : " 4 " ) < < " \" \n " // For x64 format "4" (Edit and continue) is not supported, thus we default to "3"
< < " \t \t AdditionalOption= \" " < < ( configuration = = " Analysis " ? " /analyze " : " " ) < < " \" \n "
< < " \t /> \n "
< < " \t <Tool \n "
< < " \t \t Name= \" VCLinkerTool \" \n "
< < " \t \t LinkIncremental= \" 2 \" \n "
< < " \t \t GenerateManifest= \" false \" \n "
< < " \t \t GenerateDebugInformation= \" true \" \n "
< < " \t \t IgnoreDefaultLibraryNames= \" libcmt.lib \" \n " ;
2010-11-23 11:47:52 +00:00
}
properties < < " \t /> \n "
2020-07-14 09:34:04 +02:00
< < " </VisualStudioPropertySheet> \n " ;
2010-11-23 11:47:52 +00:00
properties . flush ( ) ;
properties . close ( ) ;
}
void VisualStudioProvider : : writeFileListToProject ( const FileNode & dir , std : : ofstream & projectFile , const int indentation ,
const StringList & duplicate , const std : : string & objPrefix , const std : : string & filePrefix ) {
const std : : string indentString = getIndent ( indentation + 2 ) ;
if ( indentation )
projectFile < < getIndent ( indentation + 1 ) < < " <Filter \t Name= \" " < < dir . name < < " \" > \n " ;
for ( FileNode : : NodeList : : const_iterator i = dir . children . begin ( ) ; i ! = dir . children . end ( ) ; + + i ) {
const FileNode * node = * i ;
if ( ! node - > children . empty ( ) ) {
writeFileListToProject ( * node , projectFile , indentation + 1 , duplicate , objPrefix + node - > name + ' _ ' , filePrefix + node - > name + ' / ' ) ;
} else {
if ( producesObjectFile ( node - > name ) ) {
std : : string name , ext ;
splitFilename ( node - > name , name , ext ) ;
2016-12-17 15:12:52 -05:00
name + = " .o " ;
std : : transform ( name . begin ( ) , name . end ( ) , name . begin ( ) , tolower ) ;
const bool isDuplicate = ( std : : find ( duplicate . begin ( ) , duplicate . end ( ) , name ) ! = duplicate . end ( ) ) ;
2020-07-13 06:30:06 +01:00
std : : string filePath = convertPathToWin ( filePrefix + node - > name ) ;
2010-11-23 11:47:52 +00:00
if ( ext = = " asm " ) {
std : : string objFileName = " $(IntDir) \\ " ;
if ( isDuplicate )
objFileName + = objPrefix ;
objFileName + = " $(InputName).obj " ;
const std : : string toolLine = indentString + " \t \t <Tool Name= \" VCCustomBuildTool \" CommandLine= \" nasm.exe -f win32 -g -o " " + objFileName + " " "$(InputPath)"
 \" Outputs= \" " + objFileName + " \" /> \n " ;
// NASM is not supported for x64, thus we do not need to add additional entries here :-).
2020-07-13 06:30:06 +01:00
writeFileToProject ( projectFile , filePath , ARCH_X86 , indentString , toolLine ) ;
2010-11-23 11:47:52 +00:00
} else {
if ( isDuplicate ) {
const std : : string toolLine = indentString + " \t \t <Tool Name= \" VCCLCompilerTool \" ObjectFile= \" $(IntDir) \\ " + objPrefix + " $(InputName).obj \" XMLDocumentationFileName= \" $(IntDir) \\ " + objPrefix + " $(InputName).xdc \" /> \n " ;
2020-07-13 06:30:06 +01:00
for ( std : : list < MSVC_Architecture > : : const_iterator arch = _archs . begin ( ) ; arch ! = _archs . end ( ) ; + + arch ) {
writeFileToProject ( projectFile , filePath , * arch , indentString , toolLine ) ;
}
2010-11-23 11:47:52 +00:00
} else {
projectFile < < indentString < < " <File RelativePath= \" " < < convertPathToWin ( filePrefix + node - > name ) < < " \" /> \n " ;
}
}
} else {
projectFile < < indentString < < " <File RelativePath= \" " < < convertPathToWin ( filePrefix + node - > name ) < < " \" /> \n " ;
}
}
}
if ( indentation )
projectFile < < getIndent ( indentation + 1 ) < < " </Filter> \n " ;
}
2020-07-13 06:30:06 +01:00
void VisualStudioProvider : : writeFileToProject ( std : : ofstream & projectFile , const std : : string & filePath , MSVC_Architecture arch ,
2020-07-14 09:34:04 +02:00
const std : : string & indentString , const std : : string & toolLine ) {
2020-07-13 06:30:06 +01:00
projectFile < < indentString < < " <File RelativePath= \" " < < filePath < < " \" > \n "
< < indentString < < " \t <FileConfiguration Name= \" Debug| " < < getMSVCConfigName ( arch ) < < " \" > \n "
< < toolLine
< < indentString < < " \t </FileConfiguration> \n "
< < indentString < < " \t <FileConfiguration Name= \" Analysis| " < < getMSVCConfigName ( arch ) < < " \" > \n "
< < toolLine
< < indentString < < " \t </FileConfiguration> \n "
< < indentString < < " \t <FileConfiguration Name= \" LLVM| " < < getMSVCConfigName ( arch ) < < " \" > \n "
< < toolLine
< < indentString < < " \t </FileConfiguration> \n "
< < indentString < < " \t <FileConfiguration Name= \" Release| " < < getMSVCConfigName ( arch ) < < " \" > \n "
< < toolLine
< < indentString < < " \t </FileConfiguration> \n "
< < indentString < < " </File> \n " ;
}
2020-07-14 09:34:04 +02:00
} // namespace CreateProjectTool