Subject: Re: [PATCH v2 08/11] cmake: added checks for struct stat and libiconv

From: Junio C Hamano <[email-masked]>
Date: Tue, 12 May 2020 14:16:34 -0700

"Sibi Siddharthan via GitGitGadget" <[email-masked]> writes:

> From: Sibi Siddharthan <[email-masked]>
> Subject: Re: [PATCH v2 08/11] cmake: added checks for struct stat and libiconv

s/added/add/; give a command to the codebase to "be like so", or a
command to whoever is typing changes to the editor to "make this
happen".

> The CMake script now checks whether st_blocks is a member of struct stat
> and set the compile definition NO_ST_BLOCKS_IN_STRUCT_STAT accordingly.

	Teach the CMake script to check ...

> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 4353080b708..975791c8b89 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -22,6 +22,7 @@ project(git
>  include(CheckTypeSize)
>  include(CheckCSourceRuns)
>  include(CheckCSourceCompiles)
> +include(CheckCSourceRuns)
> ...
> +#check for st_blocks in struct stat
> +check_struct_has_member("struct stat" st_blocks "sys/stat.h" STRUCT_STAT_HAS_ST_BLOCKS)
> +if(NOT STRUCT_STAT_HAS_ST_BLOCKS)
> +	add_compile_definitions(NO_ST_BLOCKS_IN_STRUCT_STAT)
> +endif()

All of these compatibility stuff makes sense, but how do we decide
where to draw the line between the checks we saw added in [01/11]
and the checks added here?  It feels pretty arbitrary to me and if
that is the case, perhaps we want to move all the "add checks" to a
commit separate from [01/11] (whose primary purpose is to add the
basic rules without these build tweaks in the file at the final
place)?