Welcome! Log In Create A New Profile

Advanced

[PATCH] Provide support for CXXFLAGS for c++ modules

Vasily Chekalkin
November 15, 2015 05:40PM
# HG changeset patch
# User Vasily Chekalkin <bacek@bacek.com>
# Date 1447626235 -39600
# Mon Nov 16 09:23:55 2015 +1100
# Node ID 07ad1f9b4307940ecd0b952badba80fab7caba4b
# Parent ec6b07be88a5108d5b48386e06abe1d1bf975ab3
Provide support for CXXFLAGS for c++ modules.

When you want to implement module in modern C++ (e.g. c++11, etc) you have to
specify --std=c++11 in compiler command line. In this case GCC will complain
about using this flag for non-c++ sources. To avoid unnecessary clutter we
separate CFLAGS and CXXFLAGS.

diff -r ec6b07be88a5 -r 07ad1f9b4307 auto/make
--- a/auto/make Fri Nov 13 20:10:50 2015 +0300
+++ b/auto/make Mon Nov 16 09:23:55 2015 +1100
@@ -22,6 +22,7 @@

CC = $CC
CFLAGS = $CFLAGS
+CXXFLAGS = $CXXFLAGS
CPP = $CPP
LINK = $LINK

@@ -410,10 +411,16 @@

ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`

+ # Append CXXFLAGS iff source is c++
+ ngx_cpp=`echo $ngx_src \
+ | sed -e "s#^.*\.cpp\\$# \\$(CXXFLAGS)#" \
+ -e "s#^.*\.cc\\$# \\$(CXXFLAGS)#" \
+ -e "s#^$ngx_src\\$##g"`
+
cat << END >> $NGX_MAKEFILE

$ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
- $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
+ $ngx_cc$ngx_cpp$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX

END
done

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Provide support for CXXFLAGS for c++ modules

Vasily Chekalkin 526 November 15, 2015 05:40PM

Re: [PATCH] Provide support for CXXFLAGS for c++ modules

Maxim Dounin 396 November 16, 2015 10:30AM



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

Online Users

Guests: 240
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