Exemplo n.º 1
0
        public override string GetCompilerArguments(Project superProject, Project project, Language language)
        {
            string result = string.Empty;

            result += "-Wall -c -g ";

            // toolchain includes

            // Referenced includes
            var referencedIncludes = project.GetReferencedIncludes();

            foreach (var include in referencedIncludes)
            {
                result += string.Format("-I\"{0}\" ", Path.Combine(project.CurrentDirectory, include));
            }

            // global includes
            var globalIncludes = superProject.GetGlobalIncludes();

            foreach (var include in globalIncludes)
            {
                result += string.Format("-I\"{0}\" ", include);
            }

            // public includes
            foreach (var include in project.PublicIncludes)
            {
                result += string.Format("-I\"{0}\" ", Path.Combine(project.CurrentDirectory, include));
            }

            // includes
            foreach (var include in project.Includes)
            {
                result += string.Format("-I\"{0}\" ", Path.Combine(project.CurrentDirectory, include));
            }

            foreach (var define in superProject.Defines)
            {
                result += string.Format("-D{0} ", define);
            }

            foreach (var arg in superProject.ToolChainArguments)
            {
                result += string.Format(" {0}", arg);
            }

            foreach (var arg in superProject.CompilerArguments)
            {
                result += string.Format(" {0}", arg);
            }

            switch (language)
            {
                case Language.C:
                    {
                        foreach (var arg in superProject.CCompilerArguments)
                        {
                            result += string.Format(" {0}", arg);
                        }
                    }
                    break;

                case Language.Cpp:
                    {
                        foreach (var arg in superProject.CppCompilerArguments)
                        {
                            result += string.Format(" {0}", arg);
                        }
                    }
                    break;
            }

            return result;
        }