modified ReactOS-generic.rbuild

modified   ReactOS-i386.rbuild
modified   tools/rbuild/backend/mingw/mingw.cpp
   Don't feed GCC options in MSC
   Minor detection fixes

Support for the Microsoft compiler is now fully functional: now get off your grotesquely fat asses and start fixing code so that it compiles with it

TODO: make it fully functional for real (PCH, full dependencies); Microsoft linker support

svn path=/trunk/; revision=41374
This commit is contained in:
KJK::Hyperion 2009-06-10 19:12:18 +00:00
parent c828055508
commit e1dbbac2c4
3 changed files with 94 additions and 53 deletions

View file

@ -121,5 +121,5 @@
<xi:include href="tools/tools.rbuild" />
</directory>
<compilerflag compiler="cxx">-Wno-non-virtual-dtor</compilerflag>
<compilerflag compiler="cxx" compilerset="gcc">-Wno-non-virtual-dtor</compilerflag>
</group>

View file

@ -19,6 +19,7 @@
<property name="NTOSKRNL_SHARED" value="-file-alignment=0x1000 -section-alignment=0x1000 -shared"/>
<property name="PLATFORM" value="PC"/>
<group compilerset="gcc">
<if property="OPTIMIZE" value="1">
<compilerflag>-Os</compilerflag>
<compilerflag>-ftracer</compilerflag>
@ -43,6 +44,39 @@
<compilerflag>-Wpointer-arith</compilerflag>
<compilerflag>-Wno-multichar</compilerflag>
<!-- compilerflag>-H</compilerflag> enable this for header traces -->
</group>
<group compilerset="msc">
<if property="OPTIMIZE" value="1">
<compilerflag>/O1</compilerflag>
</if>
<if property="OPTIMIZE" value="2">
<compilerflag>/O2</compilerflag>
</if>
<if property="OPTIMIZE" value="3">
<compilerflag>/Ox /GS-</compilerflag>
<compilerflag>/Ot</compilerflag>
</if>
<if property="OPTIMIZE" value="4">
<compilerflag>/Ox /GS-</compilerflag>
<compilerflag>/Os</compilerflag>
</if>
<if property="OPTIMIZE" value="5">
<compilerflag>/Ox /GS-</compilerflag>
<compilerflag>/Os</compilerflag>
<compilerflag>/Ob2</compilerflag>
<compilerflag>/GF</compilerflag>
<compilerflag>/Gy</compilerflag>
</if>
<compilerflag>/GS-</compilerflag>
<compilerflag>/Zl</compilerflag>
<compilerflag>/Zi</compilerflag>
<compilerflag>/Wall</compilerflag>
</group>
<group linkerset="ld">
<linkerflag>-disable-stdcall-fixup</linkerflag>
</group>
</project>

View file

@ -453,6 +453,8 @@ MingwBackend::GenerateGlobalVariables () const
GenerateGlobalProperties ( "=", ProjectNode.non_if_data );
if ( ProjectNode.configuration.Compiler == GnuGcc )
{
fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -Wall\n" );
fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
@ -468,9 +470,6 @@ MingwBackend::GenerateGlobalVariables () const
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" );
fprintf ( fMakefile, "PROJECT_ASFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" );
MingwModuleHandler::GenerateParameters ( "PROJECT", "+=", ProjectNode.non_if_data );
MingwModuleHandler::GenerateParameters ( "PROJECT_HOST", "+=", ProjectNode.host_non_if_data );
if ( usePipe )
{
fprintf ( fMakefile, "PROJECT_CFLAGS += -pipe\n" );
@ -485,6 +484,10 @@ MingwBackend::GenerateGlobalVariables () const
// Would be nice to have our own C++ runtime
fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile );
}
MingwModuleHandler::GenerateParameters ( "PROJECT", "+=", ProjectNode.non_if_data );
MingwModuleHandler::GenerateParameters ( "PROJECT_HOST", "+=", ProjectNode.host_non_if_data );
// TODO: linker flags
fprintf ( fMakefile, "PROJECT_LFLAGS := '$(shell ${TARGET_CC} -print-libgcc-file-name)' %s\n", GenerateProjectLFLAGS ().c_str () );
@ -771,6 +774,7 @@ MingwBackend::DetectCompiler ()
}
else if ( ProjectNode.configuration.Compiler == MicrosoftC )
{
compilerCommand = "cl";
detectedCompiler = DetectMicrosoftCompiler ( compilerVersion, mscPath );
supportedCompiler = true; // TODO
}
@ -1015,6 +1019,7 @@ MingwBackend::DetectBinutils ()
}
else if ( ProjectNode.configuration.Linker == MicrosoftLink )
{
compilerCommand = "link";
detectedBinutils = DetectMicrosoftLinker ( binutilsVersion, mslinkPath );
supportedBinutils = true; // TODO
}
@ -1094,6 +1099,8 @@ MingwBackend::DetectPipeSupport ()
else
printf ( "not detected\n" );
}
else
usePipe = false;
}
void