Welcome! Log In Create A New Profile

Advanced

Re: Using cmake with nginx

Maxim Dounin
December 05, 2022 06:04PM
Hello!

On Mon, Dec 05, 2022 at 03:16:50AM +0300, Dmitry Petrov wrote:

> >So, the issues you are talking about is the fact that nginx won't
> magically find out which header files you are using, but instead
> requires you to list them in the ngx_module_deps variable when
> calling the auto/module in the module config script, correct?
>
> That's not magic. This is what make + gcc/clang/icc can do on *nix. The
> general pattern is simple:
> -include $dep
> $obj $dep: $src
> $(CC) ... -MMD -MP -MT $obj -MT $dep ...
> This would make the compiler generate a dependency file together with an
> object file and make would include/update it when needed.
> I'm not aware if nginx supports compilers other than gcc/clang, but this
> trick would work for said compilers. icc mimics gcc on Linux, so generally
> it will work there too . I'm attaching objs/ngx_modules.d being
> automatically generated by this approach.

nginx supports a wide range of C compilers, not just gcc/clang,
including ones very different form gcc, such as MSVC on Windows
(used in practice to build nginx binaries for Windows) or Sun C on
Solaris. Further, nginx is expected to be buildable with any
POSIX-complaint C compiler, which is assumed by default.

Summing the above, the gcc/clang feature in question certainly
won't make it possible to bypass listing header files manually.

It might be a way to improve rebuild times on systems using
gcc/clang, though I suspect it might not worth the effort (or
might even increase build times in typical case due to additional
work being done). Especially given that building nginx with
default modules on a cheap i7-4770 server takes less than 5
seconds of real time, and less than 15 seconds on an old i5-8210Y
laptop.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
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 428 December 02, 2022 06:10AM

Re: Using cmake with nginx

Maxim Dounin 116 December 02, 2022 11:08AM

Re: Using cmake with nginx

Dmitry Petrov 111 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 105 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