Version 1.7.0 introduced a parameter to the configure_file() call in aws-cpp-sdk-core/CMakeLists.txt that forces the re-generated VersionConfig.h file to Unix line endings (LF). This was done in commit ffd81252bec92f3e0587e144b07c05f8aed28eb1 and the commit message gives no indication why this change was necessary.
The effect of this is that when building the SDK on a clean checkout with Windows line endings (eg. on a Windows machine that has git configured to core.autocrlf=true), the re-generated header file will be marked as modified by git because of the change in line endings. Granted, this is only a nuisance, but an unnecessary one.
I see three options here:
core.autocrlf=true. This can be achieved by adding a .gitattributes file that lists the VersionConfig.h as text eol=lf. That way, the header file will always be checked out with Unix line endings, so overwriting it from CMake will result in the exact same file again.configure_file write to CMAKE_CURRENT_SOURCE_DIR, introduce a second include directory that lives under CMAKE_BINARY_DIR and write the generated file to that one. This is the idiomatic CMake solution, as it keeps generated build artifacts out of the source tree, but it slightly complicates handling of the generated files for include and install.That was an unforced error. We'll get it fixed. We can simply remove the optional NEWLINE_STYLE argument in core's CMakeLists.txt
Perfect, thanks a lot!
Hi @ComicSansMS ,
thanks again for pointing this out, the fix has been committed and published in version 1.7.139
Most helpful comment
Hi @ComicSansMS ,
thanks again for pointing this out, the fix has been committed and published in version 1.7.139