mirror of
https://github.com/reactos/reactos.git
synced 2025-04-19 20:19:26 +00:00
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:
parent
c828055508
commit
e1dbbac2c4
3 changed files with 94 additions and 53 deletions
|
@ -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>
|
||||
|
|
|
@ -19,30 +19,64 @@
|
|||
<property name="NTOSKRNL_SHARED" value="-file-alignment=0x1000 -section-alignment=0x1000 -shared"/>
|
||||
<property name="PLATFORM" value="PC"/>
|
||||
|
||||
<if property="OPTIMIZE" value="1">
|
||||
<compilerflag>-Os</compilerflag>
|
||||
<compilerflag>-ftracer</compilerflag>
|
||||
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="2">
|
||||
<compilerflag>-Os</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="3">
|
||||
<compilerflag>-O1</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="4">
|
||||
<compilerflag>-O2</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="5">
|
||||
<compilerflag>-O3</compilerflag>
|
||||
</if>
|
||||
<group compilerset="gcc">
|
||||
<if property="OPTIMIZE" value="1">
|
||||
<compilerflag>-Os</compilerflag>
|
||||
<compilerflag>-ftracer</compilerflag>
|
||||
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="2">
|
||||
<compilerflag>-Os</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="3">
|
||||
<compilerflag>-O1</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="4">
|
||||
<compilerflag>-O2</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="5">
|
||||
<compilerflag>-O3</compilerflag>
|
||||
</if>
|
||||
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
<compilerflag>-fno-strict-aliasing</compilerflag>
|
||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
||||
<compilerflag>-Wpointer-arith</compilerflag>
|
||||
<compilerflag>-Wno-multichar</compilerflag>
|
||||
<!-- compilerflag>-H</compilerflag> enable this for header traces -->
|
||||
<linkerflag>-disable-stdcall-fixup</linkerflag>
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
<compilerflag>-fno-strict-aliasing</compilerflag>
|
||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
||||
<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>
|
||||
|
|
|
@ -453,39 +453,42 @@ MingwBackend::GenerateGlobalVariables () const
|
|||
|
||||
GenerateGlobalProperties ( "=", ProjectNode.non_if_data );
|
||||
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -Wall\n" );
|
||||
fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -march=$(OARCH)\n" );
|
||||
fprintf ( fMakefile, "endif\n" );
|
||||
fprintf ( fMakefile, "ifneq ($(TUNE),)\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -mtune=$(TUNE)\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -mtune=$(TUNE)\n" );
|
||||
fprintf ( fMakefile, "endif\n" );
|
||||
if ( ProjectNode.configuration.Compiler == GnuGcc )
|
||||
{
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -Wall\n" );
|
||||
fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -march=$(OARCH)\n" );
|
||||
fprintf ( fMakefile, "endif\n" );
|
||||
fprintf ( fMakefile, "ifneq ($(TUNE),)\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -mtune=$(TUNE)\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -mtune=$(TUNE)\n" );
|
||||
fprintf ( fMakefile, "endif\n" );
|
||||
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" );
|
||||
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+" );
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" );
|
||||
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+" );
|
||||
|
||||
if ( usePipe )
|
||||
{
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -pipe\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -pipe\n" );
|
||||
fprintf ( fMakefile, "PROJECT_ASFLAGS += -pipe\n" );
|
||||
}
|
||||
|
||||
// Because RosBE gcc is built to suck
|
||||
fputs ( "BUILTIN_HOST_CINCLUDES+= $(HOST_CFLAGS)\n", fMakefile );
|
||||
fputs ( "BUILTIN_HOST_CPPINCLUDES+= $(HOST_CFLAGS)\n", fMakefile );
|
||||
fputs ( "BUILTIN_HOST_CXXINCLUDES+= $(HOST_CPPFLAGS)\n", fMakefile );
|
||||
|
||||
// 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 );
|
||||
|
||||
if ( usePipe )
|
||||
{
|
||||
fprintf ( fMakefile, "PROJECT_CFLAGS += -pipe\n" );
|
||||
fprintf ( fMakefile, "PROJECT_CXXFLAGS += -pipe\n" );
|
||||
fprintf ( fMakefile, "PROJECT_ASFLAGS += -pipe\n" );
|
||||
}
|
||||
|
||||
// Because RosBE gcc is built to suck
|
||||
fputs ( "BUILTIN_HOST_CINCLUDES+= $(HOST_CFLAGS)\n", fMakefile );
|
||||
fputs ( "BUILTIN_HOST_CPPINCLUDES+= $(HOST_CFLAGS)\n", fMakefile );
|
||||
fputs ( "BUILTIN_HOST_CXXINCLUDES+= $(HOST_CPPFLAGS)\n", fMakefile );
|
||||
|
||||
// Would be nice to have our own C++ runtime
|
||||
fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile );
|
||||
|
||||
// TODO: linker flags
|
||||
fprintf ( fMakefile, "PROJECT_LFLAGS := '$(shell ${TARGET_CC} -print-libgcc-file-name)' %s\n", GenerateProjectLFLAGS ().c_str () );
|
||||
fprintf ( fMakefile, "PROJECT_LPPFLAGS := '$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)' '$(shell ${TARGET_CPP} -print-file-name=libgcc.a)' '$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)' '$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)' '$(shell ${TARGET_CPP} -print-file-name=libcoldname.a)'\n" );
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue