diff --git a/reactos/ReactOS-generic.rbuild b/reactos/ReactOS-generic.rbuild
index ec0ef2f04d3..aac9b87f39b 100644
--- a/reactos/ReactOS-generic.rbuild
+++ b/reactos/ReactOS-generic.rbuild
@@ -119,5 +119,4 @@
- -Wno-non-virtual-dtor
diff --git a/reactos/base/shell/explorer/explorer.rbuild b/reactos/base/shell/explorer/explorer.rbuild
index bdbcf3ad67d..61ecefe26f5 100644
--- a/reactos/base/shell/explorer/explorer.rbuild
+++ b/reactos/base/shell/explorer/explorer.rbuild
@@ -2,6 +2,7 @@
+ -Wno-non-virtual-dtor
.
diff --git a/reactos/dll/win32/glu32/glu32.rbuild b/reactos/dll/win32/glu32/glu32.rbuild
index d52231d6647..4668301fc52 100644
--- a/reactos/dll/win32/glu32/glu32.rbuild
+++ b/reactos/dll/win32/glu32/glu32.rbuild
@@ -9,6 +9,7 @@
+ -Wno-non-virtual-dtor
ntdll
opengl32
kernel32
diff --git a/reactos/dll/win32/kernel32/kernel32.rbuild b/reactos/dll/win32/kernel32/kernel32.rbuild
index 521c50f9b44..963ccf36e47 100644
--- a/reactos/dll/win32/kernel32/kernel32.rbuild
+++ b/reactos/dll/win32/kernel32/kernel32.rbuild
@@ -125,6 +125,7 @@
-fno-exceptions
-fno-rtti
+ -Wno-non-virtual-dtor
icustubs.cpp
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild b/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
index 8ac58408ee8..45b93f06eb1 100644
--- a/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
+++ b/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
@@ -7,6 +7,7 @@
-fno-exceptions
-fno-rtti
-->
+ -Wno-non-virtual-dtor
diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp
index 5a20a2ac52a..10afa360bb8 100644
--- a/reactos/tools/rbuild/backend/mingw/mingw.cpp
+++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp
@@ -392,7 +392,7 @@ MingwBackend::GenerateProjectCFlagsMacro ( const char* assignmentOperation,
if ( data.includes.size () > 0 )
fprintf (
fMakefile,
- "PROJECT_CINCLUDES %s %s\n",
+ "PROJECT_CFLAGS %s %s\n",
assignmentOperation,
MingwModuleHandler::GenerateGccIncludeParametersFromVector ( data.includes ).c_str ());
@@ -529,16 +529,15 @@ MingwBackend::GenerateGlobalVariables () const
GenerateGlobalCFlagsAndProperties ( "=", ProjectNode.non_if_data );
GenerateProjectGccOptions ( "=", ProjectNode.non_if_data );
- fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CINCLUDES) $(PROJECT_CDEFINES)\n" );
- fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CINCLUDES) $(PROJECT_CDEFINES)\n" );
+ fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CFLAGS) $(PROJECT_CDEFINES)\n" );
+ fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CFLAGS) $(PROJECT_CDEFINES)\n" );
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)'\n" );
- fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -Wall\n" );
+ fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" );
fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
- fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -march=$(OARCH)\n" );
+ fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" );
fprintf ( fMakefile, "endif\n" );
- fprintf ( fMakefile, "PROJECT_CFLAGS = $(PROJECT_GCCOPTIONS) $(PROJECT_GCC_CFLAGS)\n" );
- fprintf ( fMakefile, "PROJECT_CXXFLAGS = $(PROJECT_GCCOPTIONS) $(PROJECT_GCC_CXXFLAGS)\n" );
+ fprintf ( fMakefile, "PROJECT_CFLAGS += $(PROJECT_GCCOPTIONS)\n" );
fprintf ( fMakefile, "\n" );
}
diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
index 95af81cc57e..471b74b0854 100644
--- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
+++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
@@ -752,7 +752,7 @@ MingwModuleHandler::GenerateMacros (
{
fprintf ( fMakefile, "# MACROS\n" );
GenerateMacro ( assignmentOperation,
- commonflagsMacro,
+ cflagsMacro,
data,
&used_defs,
true );
@@ -1118,7 +1118,7 @@ Rule widlProxyRule ( "$(source): ${$(module_name)_precondition}\n"
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h -p -P $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c $(source)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_CC)\n"
- "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -fno-unit-at-a-time -c $<\n",
+ "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.o",
@@ -1141,12 +1141,12 @@ Rule gccHostRule ( "$(source): ${$(module_name)_precondition}\n"
Rule gppRule ( "$(source): ${$(module_name)_precondition}\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o: $(source)$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_CC)\n"
- "\t${gpp} -o $@ $($(module_name)_CXXFLAGS)$(compiler_flags) -c $<\n",
+ "\t${gpp} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o", NULL );
Rule gppHostRule ( "$(source): ${$(module_name)_precondition}\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o: $(source)$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_CC)\n"
- "\t${host_gpp} -o $@ $($(module_name)_CXXFLAGS)$(compiler_flags) -c $<\n",
+ "\t${host_gpp} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c $<\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o", NULL );
Rule emptyRule ( "", NULL );
@@ -1658,7 +1658,7 @@ MingwModuleHandler::GenerateObjectFileTargets ()
"\t%s -o %s %s %s -g %s\n\n",
module.cplusplus ? cppc.c_str() : cc.c_str(),
backend->GetFullName ( *pchFilename ).c_str(),
- module.cplusplus ? cxxflagsMacro.c_str() : cflagsMacro.c_str(),
+ cflagsMacro.c_str(),
GenerateCompilerParametersFromVector ( module.non_if_data.compilerFlags, module.cplusplus ? CompilerTypeCPP : CompilerTypeCC ).c_str(),
backend->GetFullName ( baseHeaderFile ).c_str() );
delete pchFilename;
@@ -1711,6 +1711,13 @@ MingwModuleHandler::GenerateArchiveTarget ()
return archiveFilename;
}
+string
+MingwModuleHandler::GetCFlagsMacro () const
+{
+ return ssprintf ( "$(%s_CFLAGS)",
+ module.name.c_str () );
+}
+
/*static*/ string
MingwModuleHandler::GetObjectsMacro ( const Module& module )
{
@@ -1840,9 +1847,7 @@ MingwModuleHandler::GenerateOtherMacros ()
fprintf ( fMakefile, "# OTHER MACROS\n" );
- commonflagsMacro = ssprintf ("%s_COMMONFLAGS", module.name.c_str ());
cflagsMacro = ssprintf ("%s_CFLAGS", module.name.c_str ());
- cxxflagsMacro = ssprintf ("%s_CXXFLAGS", module.name.c_str ());
nasmflagsMacro = ssprintf ("%s_NASMFLAGS", module.name.c_str ());
windresflagsMacro = ssprintf ("%s_RCFLAGS", module.name.c_str ());
widlflagsMacro = ssprintf ("%s_WIDLFLAGS", module.name.c_str ());
@@ -1885,10 +1890,10 @@ MingwModuleHandler::GenerateOtherMacros ()
fprintf ( fMakefile, "\n" );
}
- string globalCflags = " ";
- globalCflags += ssprintf ("$(%s)", commonflagsMacro.c_str ());
+ string globalCflags = "";
if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse )
{
+ globalCflags += " $(PROJECT_CFLAGS)";
if ( module.dynamicCRT )
globalCflags += " -D_DLL -D__USE_CRTIMP";
}
@@ -1921,20 +1926,14 @@ MingwModuleHandler::GenerateOtherMacros ()
// (TODO: Move to version-specific once this bug is fixed in GCC)
globalCflags += " -fno-optimize-sibling-calls";
+ fprintf (
+ fMakefile,
+ "%s +=%s\n",
+ cflagsMacro.c_str (),
+ globalCflags.c_str () );
+
if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse )
{
- fprintf (
- fMakefile,
- "%s +=%s\n",
- cflagsMacro.c_str (),
- (" $(PROJECT_CFLAGS)" + globalCflags).c_str () );
-
- fprintf (
- fMakefile,
- "%s +=%s\n",
- cxxflagsMacro.c_str (),
- (" $(PROJECT_CXXFLAGS)" + globalCflags).c_str () );
-
fprintf (
fMakefile,
"%s += $(PROJECT_RCFLAGS)\n",
@@ -1954,18 +1953,6 @@ MingwModuleHandler::GenerateOtherMacros ()
}
else
{
- fprintf (
- fMakefile,
- "%s +=%s\n",
- cflagsMacro.c_str (),
- globalCflags.c_str () );
-
- fprintf (
- fMakefile,
- "%s +=%s\n",
- cxxflagsMacro.c_str (),
- globalCflags.c_str () );
-
fprintf (
fMakefile,
"%s_LFLAGS += $(HOST_LFLAGS)\n",
@@ -1985,10 +1972,6 @@ MingwModuleHandler::GenerateOtherMacros ()
"%s += %s\n\n",
cflagsMacro.c_str (),
cflags );
- fprintf ( fMakefile,
- "%s += %s\n\n",
- cxxflagsMacro.c_str (),
- cflags );
}
const char* nasmflags = ModuleHandlerInformations[module.type].nasmflags;
@@ -2014,17 +1997,12 @@ MingwModuleHandler::GenerateOtherMacros ()
fprintf ( fMakefile,
"%s += -Wno-main\n\n",
cflagsMacro.c_str () );
- fprintf ( fMakefile,
- "%s += -Wno-main\n\n",
- cxxflagsMacro.c_str () );
}
fprintf ( fMakefile, "\n\n" );
// future references to the macros will be to get their values
- commonflagsMacro = ssprintf ("$(%s)", commonflagsMacro.c_str ());
cflagsMacro = ssprintf ("$(%s)", cflagsMacro.c_str ());
- cxxflagsMacro = ssprintf ("$(%s)", cxxflagsMacro.c_str ());
nasmflagsMacro = ssprintf ("$(%s)", nasmflagsMacro.c_str ());
widlflagsMacro = ssprintf ("$(%s)", widlflagsMacro.c_str ());
}
diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h
index 83210bcdc26..9c8895ec598 100644
--- a/reactos/tools/rbuild/backend/mingw/modulehandler.h
+++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h
@@ -98,6 +98,7 @@ protected:
const Module& module ) const;
std::string GetPreconditionDependenciesName () const;
+ std::string GetCFlagsMacro () const;
static std::string GetObjectsMacro ( const Module& );
std::string GetLinkingDependenciesMacro () const;
std::string GetLibsMacro () const;
@@ -171,9 +172,7 @@ private:
public:
const Module& module;
string_list clean_files;
- std::string commonflagsMacro;
std::string cflagsMacro;
- std::string cxxflagsMacro;
std::string nasmflagsMacro;
std::string windresflagsMacro;
std::string widlflagsMacro;