Opened 4 months ago

Closed 4 months ago

#1994 closed defect (invalid)

$CPPFLAGS lost and handling of C++ files broken

Reported by:… Owned by:
Priority: blocker Milestone:
Component: nginx-core Version: 1.19.x
Keywords: Cc:
uname -a: Darwin Zero.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64
nginx -V: configure arguments: --with-ld-opt=-lc++ --add-module=/Users/asher/Projects/mho/nginx/pro_post_handler --add-module=/Users/asher/Projects/mho/nginx/pro_sms --with-debug --with-cc-opt='-O0' --prefix=/Users/asher/Projects/Deployment/nginx/server_root


The handling of cpp files and corresponding flags seems to have changed with 1.19. Using the exact same setup, my modules build perfectly on 1.18, but 1.19 does not retain $CPPFLAGS. In particular, clang modules flags (-fmodules -fmodules-ts -fcxx-modules -fno-implicit-module-maps -Wincomplete-umbrella) are not retained, making it impossible to build my code.

Change History (1)

comment:1 by Maxim Dounin, 4 months ago

Resolution: invalid
Status: newclosed

The CPPFLAGS variable is to set flags to CPP, C preprocessor (see, for example, here. You probably mean to use CXXFLAGS instead, which are indeed related to building C++. These are not supported by nginx though, and never was (and likely won't be supported, see here, here, and here). Consider using --with-cc-opt= or CFLAGS to provide needed build flags. Alternatively, consider using config.make to provide make instruction to build your code.

And, just to clarify, there are no build-related changes between nginx 1.18.0 and 1.19.0. You can find it yourself by looking into repository and/or simply comparing the auto/ directories.

If you need further help, consider using support options available. Make sure to ask questions the smart way.

Note: See TracTickets for help on using tickets.