diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2018-06-24 21:56:32 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2018-06-24 21:56:32 +0200 |
commit | b71da61dd16b73ff1f12056ad418f31900ae8f8f (patch) | |
tree | 84095ae34123da41909352e95a9005e8c6765b7d /templates/Makefile.template | |
parent | c6ed823ef7f1b1b4254110aef5f0a30bf101fe4a (diff) |
c++14-compat is c++ only.
Diffstat (limited to 'templates/Makefile.template')
-rw-r--r-- | templates/Makefile.template | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/templates/Makefile.template b/templates/Makefile.template index afab229fae..caf6c12646 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -37,7 +37,7 @@ # warnings we'd like, but that dont exist in all compilers PREFERRED_WARNINGS=['shadow', 'extra-semi'] - CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-c++14-compat', 'no-unused-but-set-variable'] + CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-unused-but-set-variable'] def warning_var(fmt, warning): return fmt % warning.replace('-', '_').replace('+', 'X').upper() @@ -191,6 +191,12 @@ TMPOUT = `mktemp /tmp/test-out-XXXXXX` endif + CHECK_NO_CXX14_COMPAT_WORKS_CMD = $(CC) -std=c++11 -Werror -Wno-c++14-compat -o $(TMPOUT) -c test/build/no-c++14-compat.cc + HAS_WORKING_NO_CXX14_COMPAT = $(shell $(CHECK_NO_CXX14_COMPAT_WORKS_CMD) 2> /dev/null && echo true || echo false) + ifeq ($(HAS_WORKING_NO_CXX14_COMPAT),true) + W_NO_CXX14_COMPAT=-Wno-c++14-compat + endif + %for warning in CHECK_WARNINGS: ${warning_var('CHECK_%s_WORKS_CMD', warning)} = $(CC) -std=c99 -Werror -W${warning} -o $(TMPOUT) -c test/build/${warning}.c ${warning_var('HAS_WORKING_%s', warning)} = $(shell $(${warning_var('CHECK_%s_WORKS_CMD', warning)}) 2> /dev/null && echo true || echo false) |