Re: [PATCH v2 08/11] cmake: added checks for struct stat and libiconv
- From
Sibi Siddharthan <sibisiddharthan.github@gmail.com>
- Date
- May 13, 2020, 20:05 UTC
- Message-ID
- <CAKiG+9VrKsckfnJiaf1xMYnOtJ6wvnbtZv4-3sz6H7h3aZH3Cg@mail.gmail.com>
- In-Reply-To
- <xmqqblmsc0r1.fsf@gitster.c.googlers.com>
On Wed, May 13, 2020 at 2:46 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 39 quoted lines
>
> "Sibi Siddharthan via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
> > 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)?
>The checks are added on a "demand" based the target platform. In the future, if apple support is needed, we need to add ST_TIMESPEC checks.
Thank You, Sibi Siddharthan