buglibiconv - Bugs: bug #64293, Add CMake build system support

 
 

bug #64293: Add CMake build system support

Submitter:  Chen Pi <chenpi11>
Submitted:  Sun 11 Jun 2023 08:05:21 AM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Not a Bug
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 11 Jun 2023 12:40:06 PM UTC, comment #1: 

Thanks for the submission and constructive criticism.

> Sometimes, when cross-compiling aarch64 GNU LIBICONV on MacOS using Autotools,
> configure does not detect the aarch64 cross-compiler properly and ends up
> compiling with the native x86_64 compiler without a clear warning, leading to
> incorrect compilation results.


When cross-compiling, you typically need to use both the --host=...
configure argument and the CC environment variable or configure argument.
One without the other will not work. This ought to be documented in the
INSTALL.generic file. If it is not, we need to improve that file.

> I believe that CMake can also improve the convenience of building
> GNU LIBICONV, such as compiling using MSVC toolchain on Windows operating
> system, without requiring MinGW, GNU Make, GNU Autotools, Core POSIX
> utilities, Grep, Awk, etc.


The main focus of the GNU project is on GNU and POSIX compatible platforms.
Native Windows support is an "extra" for GNU packages. If compiling with
the MSVC toolchain is slow, that is not a major problem; the developer
can simply do other tasks at the same time.

> By supporting CMake, GNU LIBICONV can better
> integrate into modern software development processes.
> ...
> some people here complained that libiconv
> doesn't support CMake compilation, which caused their project development to
> stagnate for a while.


That is unusual and unexpected. People can very well read the documentation
and build the package as documented. They can also, alternatively, use the
binaries from https://mlocati.github.io/articles/gettext-iconv-windows.html .

> Nowadays, many C/C++ projects use CMake for compilation, which can be compiled
> without a POSIX environment.
>
> Firstly, CMake is a widely used modern build system and has become one of the
> preferred compilation tools for many software projects. Compared to Autotools,
> CMake has simpler and more intuitive syntax, as well as being more stable and
> easier to maintain and expand.


This was already discussed in the mail thread at
https://lists.gnu.org/archive/html/bug-gnu-libiconv/2020-05/msg00010.html
https://lists.gnu.org/archive/html/bug-gnu-libiconv/2020-06/msg00002.html

Bruno Haible <haible>
Group administrator
Sun 11 Jun 2023 08:05:21 AM UTC, original submission:  

Nowadays, many C/C++ projects use CMake for compilation, which can be compiled without a POSIX environment.

Firstly, CMake is a widely used modern build system and has become one of the preferred compilation tools for many software projects. Compared to Autotools, CMake has simpler and more intuitive syntax, as well as being more stable and easier to maintain and expand. By supporting CMake, GNU LIBICONV can better integrate into modern software development processes.

Secondly, I believe that CMake can also improve the convenience of building GNU LIBICONV, such as compiling using MSVC toolchain on Windows operating system, without requiring MinGW, GNU Make, GNU Autotools, Core POSIX utilities, Grep, Awk, etc.

Furthermore, CMake is more stable than Autotools in cross-compiling. Sometimes, when cross-compiling aarch64 GNU LIBICONV on MacOS using Autotools, configure does not detect the aarch64 cross-compiler properly and ends up compiling with the native x86_64 compiler without a clear warning, leading to incorrect compilation results.

I'm submitting this item because some people here complained that libiconv doesn't support CMake compilation, which caused their project development to stagnate for a while.

Finally, I want to clarify that, after my testing, building libiconv using CMake is totally feasible and has passed the tests. Of course, this is for my redistribution version based on GNU LIBICONV and may not be entirely applicable to GNU LIBICONV.

Thank you.

Here is my distribution of libiconv with CMake support:

cppp-project/cppp-reiconv


Chen Pi <chenpi11>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by chenpi11 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-06-11 haible StatusNone Not a Bug
        Assigned toNone haible
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code