Skip to content

Commit

Permalink
win32/makefiles: only add -std:c++20 for USE_CPLUSPLUS
Browse files Browse the repository at this point in the history
and note that only 2019 or later can build as C++, since the
use of designated initialisers means we need at least C++20 and
only 2019 and 2022 support that.

"cl /?" for 2019 doesn't list "-std:c++20" as an option at least of
19.29.30148, but it does accept it.
  • Loading branch information
tonycoz authored and Leont committed May 24, 2023
1 parent 91eb439 commit 97a167a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion win32/GNUmakefile
Expand Up @@ -180,6 +180,7 @@ DEFAULT_INC_EXCLUDES_DOT := define

#
# Uncomment this if you want to build everything in C++ mode
# This requires gcc or at least MSVC 2019.
#
#USE_CPLUSPLUS := define

Expand Down Expand Up @@ -671,7 +672,10 @@ INCLUDES = -I.\include -I. -I..
#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT
LOCDEFS = -DPERLDLL -DPERL_CORE
CXX_FLAG = -TP -EHsc -std:c++20
CXX_FLAG = -TP -EHsc
ifeq ($(USE_CPLUSPLUS),define)
CXX_FLAG += -std:c++20
endif
EXTRACFLAGS = -nologo -GF -W3

ifeq ($(CCTYPE),MSVC120)
Expand Down
6 changes: 5 additions & 1 deletion win32/Makefile
Expand Up @@ -120,6 +120,7 @@ DEFAULT_INC_EXCLUDES_DOT = define

#
# Uncomment this if you want to build everything in C++ mode
# This requires at least MSVC 2019.
#
#USE_CPLUSPLUS = define

Expand Down Expand Up @@ -431,7 +432,10 @@ INCLUDES = -I$(COREDIR) -I.\include -I. -I..
#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT
LOCDEFS = -DPERLDLL -DPERL_CORE
CXX_FLAG = -TP -std:c++20 -EHsc
CXX_FLAG = -TP -EHsc
!IF "$(USE_CPLUSPLUS)" == "define"
CXX_FLAG = $(CXX_FLAG) -std:c++20
!ENDIF
EXTRACFLAGS = -nologo -GF -W3

!IF "$(CCTYPE)" == "MSVC120"
Expand Down

0 comments on commit 97a167a

Please sign in to comment.