4 ms·
CMake silently disregards the C preprocessor flags environment variable (2012)
- nsajko 12y agoThat means most projects using CMake get built without CPPFLAGS in compiler options.
- deleted 12y ago[deleted]
- justincormack 12y agoWhich usually works, but there are some cross compiling and other options that need it (actually largefile options on 32 bit setups that need it like glibc, alas that hasnt died yet).
- byuu 12y agoWhy do people use .cpp for files and yet CXXFLAGS for makefiles, anyway? (also see .cc, but almost never .cxx)
- quesera 12y agoCPP in CPPFLAGS means "C PreProcessor", and pre-dates C++. This collision is why CXXFLAGS was chosen for C++ compile-time flags. ('+' being an inconvenient literal to use in a shell environment.) The .cpp extension comes from platforms where CPPFLAGS didn't exist, i.e. not UNIX. I think .cc has always been preferred on UNIX platforms, though .C used to be common as well.
- kazinator 12y agoYou wouldn't see .cxx because why would anyone use that suffix if they could simply make it .c++, right? The XX glyphs are the closest thing to the + glyph that can be used in a shell or make variable name.
- rossy 12y agoWell, it's concerning that this is used to pass security related flags (-D_FORTIFY_SOURCE,) and it appears to have been open since 2012. I didn't think use of CPPFLAGS was that obscure, though I guess it has an unfortunately confusing name.
- miander 12y agoI think that open-source projects need to take these questions of usability more seriously. There seems to be an unspoken but pervasive attitude that features should not be added for convenience or to guide inexperienced users when they make a mistake. To go on a tangent, I think this is why Linux desktop environments still lag behind in usability; Windows and Mac chose their fate a long time ago.
- TTPrograms 12y agoThe attitude I would find most helpful would be one of "sane defaults". It should be possible for beginning users to get up and running doing things with the most minimal amount of configuration possible. Then as the user learns more they can replace bits of the default piecewise with config files that only overwrite the specified attributes.
- deleted 12y ago[deleted]
- mlvljr 12y agoSounds like smth quite in the spirit of CMake, not surprised a tiniest bit (and not humorous either).