Implemented "cppflags" for specific source files
This commit is contained in:
parent
c4b1894412
commit
33cf741d57
@ -1184,6 +1184,7 @@ static int _target_source(Configure * configure, FILE * fp,
|
|||||||
ObjectType ot;
|
ObjectType ot;
|
||||||
size_t len;
|
size_t len;
|
||||||
String const * p;
|
String const * p;
|
||||||
|
String const * q;
|
||||||
|
|
||||||
if((p = config_get(configure->config, target, "type")) != NULL)
|
if((p = config_get(configure->config, target, "type")) != NULL)
|
||||||
tt = enum_string(TT_LAST, sTargetType, p);
|
tt = enum_string(TT_LAST, sTargetType, p);
|
||||||
@ -1223,18 +1224,22 @@ static int _target_source(Configure * configure, FILE * fp,
|
|||||||
fprintf(fp, ": %s.%s", source, sObjectType[ot]);
|
fprintf(fp, ": %s.%s", source, sObjectType[ot]);
|
||||||
source[len] = '.'; /* FIXME ugly */
|
source[len] = '.'; /* FIXME ugly */
|
||||||
_source_depends(configure->config, fp, source);
|
_source_depends(configure->config, fp, source);
|
||||||
p = config_get(configure->config, source, "cflags");
|
/* FIXME do both wherever also relevant */
|
||||||
|
p = config_get(configure->config, source, "cppflags");
|
||||||
|
q = config_get(configure->config, source, "cflags");
|
||||||
source[len] = '\0';
|
source[len] = '\0';
|
||||||
fputs("\n\t", fp);
|
fputs("\n\t", fp);
|
||||||
if(tt == TT_LIBTOOL)
|
if(tt == TT_LIBTOOL)
|
||||||
fputs("$(LIBTOOL) --mode=compile ", fp);
|
fputs("$(LIBTOOL) --mode=compile ", fp);
|
||||||
fprintf(fp, "%s%s%s", "$(CC) $(", target,
|
fputs("$(CC)", fp);
|
||||||
"_CFLAGS)");
|
|
||||||
if(p != NULL)
|
if(p != NULL)
|
||||||
{
|
|
||||||
fprintf(fp, " %s", p);
|
fprintf(fp, " %s", p);
|
||||||
|
fprintf(fp, "%s%s%s", " $(", target, "_CFLAGS)");
|
||||||
|
if(q != NULL)
|
||||||
|
{
|
||||||
|
fprintf(fp, " %s", q);
|
||||||
if(configure->os == HO_GNU_LINUX
|
if(configure->os == HO_GNU_LINUX
|
||||||
&& string_find(p, "-ansi"))
|
&& string_find(q, "-ansi"))
|
||||||
fputs(" -D _GNU_SOURCE", fp);
|
fputs(" -D _GNU_SOURCE", fp);
|
||||||
}
|
}
|
||||||
if(string_find(source, "/"))
|
if(string_find(source, "/"))
|
||||||
|
Loading…
Reference in New Issue
Block a user