mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
adding gccasm.rules to vcproj files
now it is possible to compile .s files with msvc svn path=/trunk/; revision=18671
This commit is contained in:
parent
aff22063c4
commit
fd0fbedd9e
3 changed files with 62 additions and 9 deletions
|
@ -54,10 +54,21 @@ MSVCBackend::MSVCBackend(Project &project,
|
|||
void MSVCBackend::Process()
|
||||
{
|
||||
string filename_sln ( ProjectNode.name );
|
||||
string filename_rules = "gccasm.rules";
|
||||
|
||||
if ( configuration.VSProjectVersion == "6.00" )
|
||||
filename_sln += ".dsw";
|
||||
else
|
||||
else {
|
||||
filename_sln += ".sln";
|
||||
|
||||
m_rulesFile = fopen ( filename_rules.c_str(), "wb" );
|
||||
if ( m_rulesFile )
|
||||
{
|
||||
_generate_rules_file ( m_rulesFile );
|
||||
}
|
||||
fclose ( m_rulesFile );
|
||||
}
|
||||
|
||||
printf ( "Creating MSVC workspace: %s\n", filename_sln.c_str() );
|
||||
|
||||
ProcessModules();
|
||||
|
|
|
@ -63,6 +63,7 @@ class MSVCBackend : public Backend
|
|||
|
||||
FILE* m_dswFile;
|
||||
FILE* m_slnFile;
|
||||
FILE* m_rulesFile;
|
||||
|
||||
// functions in msvcmaker.cpp:
|
||||
|
||||
|
@ -79,6 +80,7 @@ class MSVCBackend : public Backend
|
|||
|
||||
// functions in vcprojmaker.cpp:
|
||||
|
||||
std::string _get_solution_verion ( void );
|
||||
std::string _gen_guid();
|
||||
std::string _replace_str(
|
||||
std::string string1,
|
||||
|
@ -90,10 +92,11 @@ class MSVCBackend : public Backend
|
|||
void _generate_sln_header ( FILE* OUT );
|
||||
void _generate_sln_footer ( FILE* OUT );
|
||||
void _generate_sln ( FILE* OUT );
|
||||
void _generate_rules_file ( FILE* OUT );
|
||||
void _generate_sln_project (
|
||||
FILE* OUT,
|
||||
const Module& module,
|
||||
std::string dsp_file,
|
||||
std::string vcproj_file,
|
||||
std::string sln_guid,
|
||||
std::string vcproj_guid,
|
||||
const std::vector<Dependency*>& dependencies );
|
||||
|
|
|
@ -190,6 +190,15 @@ MSVCBackend::_generate_vcproj ( const Module& module )
|
|||
fprintf ( OUT, "\t\t\tName=\"Win32\"/>\r\n" );
|
||||
fprintf ( OUT, "\t</Platforms>\r\n" );
|
||||
|
||||
fprintf ( OUT, "\t<ToolFiles>\r\n" );
|
||||
fprintf ( OUT, "\t\t<ToolFile\r\n" );
|
||||
|
||||
string path = Path::RelativeFromDirectory ( ProjectNode.name, module.GetBasePath() );
|
||||
path.erase(path.find(ProjectNode.name, 0), ProjectNode.name.size() + 1);
|
||||
|
||||
fprintf ( OUT, "\t\t\tRelativePath=\"%s/gccasm.rules\"/>\r\n", path.c_str() );
|
||||
fprintf ( OUT, "\t</ToolFiles>\r\n" );
|
||||
|
||||
int n = 0;
|
||||
|
||||
std::string output_dir;
|
||||
|
@ -352,7 +361,7 @@ MSVCBackend::_generate_vcproj ( const Module& module )
|
|||
// Source files
|
||||
fprintf ( OUT, "\t\t<Filter\r\n" );
|
||||
fprintf ( OUT, "\t\t\tName=\"Source Files\"\r\n" );
|
||||
fprintf ( OUT, "\t\t\tFilter=\"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\">\r\n" );
|
||||
fprintf ( OUT, "\t\t\tFilter=\"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;S\">\r\n" );
|
||||
for ( size_t isrcfile = 0; isrcfile < source_files.size(); isrcfile++ )
|
||||
{
|
||||
const string& source_file = DosSeparator(source_files[isrcfile]);
|
||||
|
@ -410,14 +419,13 @@ MSVCBackend::_replace_str(std::string string1, const std::string &find_str, cons
|
|||
return string1;
|
||||
}
|
||||
|
||||
void
|
||||
MSVCBackend::_generate_sln_header ( FILE* OUT )
|
||||
{
|
||||
std::string
|
||||
MSVCBackend::_get_solution_verion ( void ) {
|
||||
string version;
|
||||
|
||||
if (configuration.VSProjectVersion.empty())
|
||||
configuration.VSProjectVersion = MS_VS_DEF_VERSION;
|
||||
|
||||
string version;
|
||||
|
||||
if (configuration.VSProjectVersion == "7.00")
|
||||
version = "7.00";
|
||||
|
||||
|
@ -427,7 +435,38 @@ MSVCBackend::_generate_sln_header ( FILE* OUT )
|
|||
if (configuration.VSProjectVersion == "8.00")
|
||||
version = "9.00";
|
||||
|
||||
fprintf ( OUT, "Microsoft Visual Studio Solution File, Format Version %s\r\n", version.c_str() );
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MSVCBackend::_generate_rules_file ( FILE* OUT )
|
||||
{
|
||||
fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" );
|
||||
fprintf ( OUT, "<VisualStudioToolFile\r\n" );
|
||||
fprintf ( OUT, "\tName=\"GCC Assembler\"\r\n" );
|
||||
fprintf ( OUT, "\tVersion=\"%s\"\r\n", _get_solution_verion().c_str() );
|
||||
fprintf ( OUT, "\t>\r\n" );
|
||||
fprintf ( OUT, "\t<Rules>\r\n" );
|
||||
fprintf ( OUT, "\t\t<CustomBuildRule\r\n" );
|
||||
fprintf ( OUT, "\t\t\tName=\"Assembler\"\r\n" );
|
||||
fprintf ( OUT, "\t\t\tDisplayName=\"Assembler Files\"\r\n" );
|
||||
fprintf ( OUT, "\t\t\tCommandLine=\"cl /E "$(InputPath)" | as -o "$(OutDir)\\$(InputName).obj"\"\r\n" );
|
||||
fprintf ( OUT, "\t\t\tOutputs=\"$(OutDir)\\$(InputName).obj\"\r\n" );
|
||||
fprintf ( OUT, "\t\t\tFileExtensions=\"*.S\"\r\n" );
|
||||
fprintf ( OUT, "\t\t\tExecutionDescription=\"asm\"\r\n" );
|
||||
fprintf ( OUT, "\t\t\t>\r\n" );
|
||||
fprintf ( OUT, "\t\t\t<Properties>\r\n" );
|
||||
fprintf ( OUT, "\t\t\t</Properties>\r\n" );
|
||||
fprintf ( OUT, "\t\t</CustomBuildRule>\r\n" );
|
||||
fprintf ( OUT, "\t</Rules>\r\n" );
|
||||
fprintf ( OUT, "</VisualStudioToolFile>\r\n" );
|
||||
}
|
||||
|
||||
void
|
||||
MSVCBackend::_generate_sln_header ( FILE* OUT )
|
||||
{
|
||||
fprintf ( OUT, "Microsoft Visual Studio Solution File, Format Version %s\r\n", _get_solution_verion().c_str() );
|
||||
fprintf ( OUT, "# Visual Studio 2005\r\n" );
|
||||
fprintf ( OUT, "\r\n" );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue