-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cmakedefine01 instead of cmakedefine #641
Conversation
👍 Makes sense to me. |
If dealing with boolean situations, I tend to prefer
Willing to hear other opinions though. |
I'm most in favor of @psigen 's proposal. Explicitly defining every command line variable could result in some hideous output if we ever need to investigate build issues. |
To clarify, do you mean to prefer to use
Please correct me if something is wrong in the following. AFAIK, they are cmake variables rather than compiler flags. Those cmake variables are determined in cmake time based on The actual preprocessors are then configured in /* #undef BUILD_TYPE_DEBUG */
#define BUILD_TYPE_RELEASE 1
/* #undef BUILD_TYPE_RELWITHDEBINFO */
/* #undef BUILD_TYPE_MINSIZEREL */
#define HAVE_NLOPT 1
#define HAVE_IPOPT 1
/* #undef HAVE_SNOPT */
#define HAVE_BULLET_COLLISION 1
#define DART_USE_FCLMESHCOLLISIONDETECTOR 0 and #define BUILD_TYPE_DEBUG 0
#define BUILD_TYPE_RELEASE 1
#define BUILD_TYPE_RELWITHDEBINFO 0
#define BUILD_TYPE_MINSIZEREL 0
#define HAVE_NLOPT 1
#define HAVE_IPOPT 1
#define HAVE_SNOPT 0
#define HAVE_BULLET_COLLISION 1
#define DART_USE_FCLMESHCOLLISIONDETECTOR 0 All these will be automatically configured by cmake without polluting the compiler flags. |
As this doesn't pollute the compiler flags, looks good to merge? |
I think this is fine as these are strictly going into a header directly. @mkoval and I discussed situations where someone might want to |
Thanks! Merging now. |
cmakedefine
defines only when the cmake variable is set to true or 1 in cmake script, whereascmakedefine01
always defines either#define VAR 1
or#define VAR 0
depending on the variable.cmakedefine
will go along with#ifdef VAR
, andcmakedefine01
will go along with#if VAR
.This might be arguable, but
#if VAR
seems to be more intuitive to use to me. I would like to know other's thoughts.