From 45198e5235f4b724277665b242cf855a0ff4518b Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 2 Apr 2024 16:06:10 +0200 Subject: Make sure we use C++ 11 It's rare we use a compiler that has anything older as a default, but it does happen sometimes. So make sure to guarantee this so we can start using more modern constructs. --- CMakeLists.txt | 3 ++- unix/xserver/hw/vnc/Makefile.am | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba6b3203..b9482b1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,8 +69,9 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-D_DEBUG) ENDIF() -# Make sure we get a sane C version +# Make sure we get a sane C and C++ version set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") # Tell the compiler to be stringent set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wvla") diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am index f9ed19d9..402e37db 100644 --- a/unix/xserver/hw/vnc/Makefile.am +++ b/unix/xserver/hw/vnc/Makefile.am @@ -14,6 +14,8 @@ AM_CPPFLAGS = \ -I$(TIGERVNC_SRCDIR)/unix/common \ $(DIX_CFLAGS) +AM_CXXFLAGS = -std=gnu++11 + noinst_LTLIBRARIES = libvnccommon.la HDRS = vncExtInit.h vncHooks.h \ -- cgit v1.2.3