]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
pzstd: use c++14 without conditions
authorAlexander Kanavin <alex@linutronix.de>
Mon, 19 Jun 2023 15:10:09 +0000 (17:10 +0200)
committerNick Terrell <nickrterrell@gmail.com>
Mon, 18 Mar 2024 16:15:26 +0000 (12:15 -0400)
Doing this check with a direct c++ snippet is prone to portability problems:

- \043 is not portable between shells: dash expands it to #,
bash does not;

- using # directly works with make 4.3 but does not with make 4.2.

Let's just use the c++ version that covers both the code and the gtest.

contrib/pzstd/Makefile

index 9604eb2438c206ee829c2853e1bfd08efb18199d..e4b3e8a21f281fc95609672179db9ebca7e597b2 100644 (file)
@@ -37,11 +37,8 @@ CFLAGS   += -Wno-deprecated-declarations
 PZSTD_INC  = -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(PROGDIR) -I.
 GTEST_INC  = -isystem googletest/googletest/include
 
-# If default C++ version is older than C++11, explicitly set C++11, which is the
-# minimum required by the code.
-ifeq ($(shell echo "\043if __cplusplus < 201103L\n\043error\n\043endif" | $(CXX) -x c++ -Werror -c - -o /dev/null 2>/dev/null && echo 1 || echo 0),0)
-PZSTD_CXX_STD := -std=c++11
-endif
+# Set the minimum required by gtest
+PZSTD_CXX_STD := -std=c++14
 
 PZSTD_CPPFLAGS  = $(PZSTD_INC)
 PZSTD_CCXXFLAGS =