FEATURE_FLAG is applicable to feature_folder - being newly introduced in the build system based on below condition in the top level makefile.
ifdef FEATURE_AAA export FEATURE_FLAG=0 else export FEATURE_FLAG=1
CPP and Header files inside the feature_folder further include some headers based on FEATURE_FLAG as below.
e.g. foo.cpp includes foo.h which has-
//Code
#if FEATURE_FLAG
#include <cstring>
#endif
//Code
a = memset(...);
//Code
- With the $(warning ...) prints in the makefiles corresponding to foo.cpp and foo.h, I have ensured that FEATURE_FLAG=1 just right before foo.cpp gets compiled. This means, the FEATURE_FLAG=1 setting works fine in the contained makefiles.
However, foo.cpp compilation gives the error as - memset not found.
If I comment the FEATURE_FLAG in the foo.h and include the cstring as default, the compilation works ok.
Q => Why doesn't the foo.h "see" the FEATURE_FLAG being set to 1?
CXX := arm-5.3-uclibc-1.0.12/usr/bin/arm-linux-g++
CC := arm-5.3-uclibc-1.0.12/usr/bin/arm-linux-gcc