Exemple #1
0
int is_cpp(const char* name)
{
	int i;
	const char* ext = path_getextension(name);
	if (ext == NULL) 
		return 0;

	for (i = 0; CPP_EXT[i] != NULL; ++i)
	{
		if (matches(ext, CPP_EXT[i]))
			return 1;
	}

	return 0;
}
Exemple #2
0
static const char* listFiles(const char* filename)
{
	int i;

	io_print("\t\t<Unit filename=\"%s\">\n", filename);
	
	if (matches(path_getextension(filename), ".rc"))
	{
		io_print("\t\t\t<Option compilerVar=\"WINDRES\" />\n");
	}
	else
	{
 		/* Default is C++ (compilerVar=CPP) */
 		if (prj_is_lang("c"))
 			io_print("\t\t\t<Option compilerVar=\"CC\" />\n");
		else
			io_print("\t\t\t<Option compilerVar=\"CPP\" />\n");
		
		if (!is_cpp(filename))
		{
			/* Look for the specified pch header */
			if (prj_has_pch() && matches(filename, prj_get_pch_header()))
			{
				io_print("\t\t\t<Option compile=\"1\" />\n");
				io_print("\t\t\t<Option weight=\"0\" />\n");
			}
		}
	}
	
	for (i = 0; i < prj_get_numconfigs(); ++i)
	{
		Package* pkg = prj_get_package();
		io_print("\t\t\t<Option target=\"%s\" />\n", pkg->configs[i]->prjConfig->name);
	}

	io_print("\t\t</Unit>\n");
	return NULL;
}