diff --git a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp index d83b2b02c3b..2ea8501a9d6 100644 --- a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp +++ b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp @@ -324,6 +324,7 @@ CBBackend::_generate_cbproj ( const Module& module ) string outenv = Environment::GetOutputPath (); string module_type = GetExtension(module.GetTargetName()); string cbproj_path = module.GetBasePath(); + string CompilerVar; //bool lib = (module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a"); //bool dll = (module_type == ".dll") || (module_type == ".cpl"); @@ -331,8 +332,15 @@ CBBackend::_generate_cbproj ( const Module& module ) //bool sys = (module_type == ".sys"); vector source_files, resource_files, includes, libraries, libpaths; - vector header_files, common_defines; + vector header_files, common_defines, compiler_flags; + vector vars, values; + compiler_flags.push_back ( "-Wall" ); + + // Always force disabling of sibling calls optimisation for GCC + // (TODO: Move to version-specific once this bug is fixed in GCC) + compiler_flags.push_back ( "-fno-optimize-sibling-calls" ); + if ( module.pch != NULL ) { string pch_path = Path::RelativeFromDirectory ( @@ -385,6 +393,11 @@ CBBackend::_generate_cbproj ( const Module& module ) libraries.push_back ( libs[i]->name ); libpaths.push_back ( libpath ); } + const vector& cflags = data.compilerFlags; + for ( i = 0; i < cflags.size(); i++ ) + { + compiler_flags.push_back ( cflags[i]->flag ); + } const vector& defs = data.defines; for ( i = 0; i < defs.size(); i++ ) { @@ -393,8 +406,17 @@ CBBackend::_generate_cbproj ( const Module& module ) else common_defines.push_back( defs[i]->name ); } + /*const vector& variables = data.properties; + for ( i = 0; i < variables.size(); i++ ) + { + vars.push_back( variables[i]->name ); + values.push_back( variables[i]->value ); + }*/ } + if ( !module.allowWarnings ) + compiler_flags.push_back ( "-Werror" ); + FILE* OUT = fopen ( cbproj_file.c_str(), "wb" ); fprintf ( OUT, "\r\n" ); @@ -408,6 +430,8 @@ CBBackend::_generate_cbproj ( const Module& module ) fprintf ( OUT, "\t\t