Fix cmake build errors related to ac_cfg.h #1707
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a few errors related to how cmake builds deal with
ac_cfg.h. This has been discussed in #1681 (comment) and following comments, and then in issue #1706.While testing, I ran
cmake .a few times which generates a cmake buildsystem inside the source tree. Some of those files still had to be added to.gitignore.Using the identifier
versioninsidesrc/main.cto refer toAVRDUDE_FULL_VERSIONis about as confusing as usingVERSIONinstead ofAVRDUDE_FULL_VERSIONwas. So I removedchar *versionand just let the functions referenceAVRDUDE_FULL_VERSIONdirectly. I trust compilers these days to have all those references refer to the same bit of constant memory, and not allocate several copies ofAVRDUDE_FULL_VERSION.Fix cmake not finding the generated
ac_cfg.hwhen the (often unused and unnecessary)src/ac_cfg.hdoes NOT exist. See commit message.And most importantly, fix the C preprocessor mistakenly looking in
src/beforebuild_$ostype/src/when looking forac_cfg.h: Change from#include "ac_cfg.h"to#include <ac_cfg.h>in all source files.