Welcome! Log In Create A New Profile

Advanced

Using cmake with nginx

Dmitry Petrov
December 02, 2022 06:10AM
Hello!

I'm sure many developers have faced issues with manual dependency handling
in the nginx build system. I've tried several workarounds which were
semi-acceptable for personal use, but definitely not something that you
would offer other people to use.

Then I thought that it would be easy to add objs/Makefile -> CMakeList.txt
converted, because makefile is strictly-formatted, but what if we add a
primitive CMakeLists.txt generator to auto/make?

I've made a quick and dirty prototype and it was quite successful (for *nix
environment as it relies on sed-ing compiler/linker flags).

I'm attaching a small patch of that proof-of-concept attempt (based on v
1.17.10). And I just want to ask if the community is interested in having
some kind of cmake support. The advantages for developers are:
- automatic dependency handling
- easier integration with clang-based tools (cmake can generate
compile_commands.json on its own rather that using tools such as
https://github.com/rizsotto/Bear)
- cmake can target not only makefiles (for example Visual Studio, if anyone
uses it)
- it's easier to use C++ with cmake as it inherently has an ability to use
different set of compiler flags for C and C++ compilers

--
Regards,
Dmitry
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

Using cmake with nginx

Dmitry Petrov 424 December 02, 2022 06:10AM

Re: Using cmake with nginx

Maxim Dounin 115 December 02, 2022 11:08AM

Re: Using cmake with nginx

Dmitry Petrov 110 December 04, 2022 03:14PM

Re: Using cmake with nginx

Maxim Dounin 108 December 04, 2022 04:12PM

Re: Using cmake with nginx Attachments

Dmitry Petrov 103 December 04, 2022 07:18PM

Re: Using cmake with nginx

Maxim Dounin 129 December 05, 2022 06:04PM

Re: Using cmake with nginx

Alejandro Colomar 101 December 04, 2022 04:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready