Skip to content

Commit 7475bde

Browse files
committed
cmake: enforce C++ 11 standard
Avoids errors on macOS like: In file included from crunch/crnlib/crn_threading.h:7: crunch/crnlib/crn_threading_pthreads.h:177:40: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~executable_task( void ) = default; ^ crunch/crnlib/crn_threading_pthreads.h:253:11: error: exception specification of overriding function is more lax than base version virtual ~object_task( void ) = default; ^ crunch/crnlib/crn_threading_pthreads.h:177:13: note: overridden virtual function is here virtual ~executable_task( void ) = default; ^ crunch/crnlib/crn_threading_pthreads.h:253:34: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions] virtual ~object_task( void ) = default; ^
1 parent b77542c commit 7475bde

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cmake_minimum_required(VERSION 3.1)
22

3+
set(CMAKE_CXX_STANDARD 11)
4+
35
set(CRUNCH_PROJECT_NAME crunch)
46
set(CRUNCH_LIBRARY_NAME crn)
57
set(CRUNCH_EXE_NAME crunch)

crnlib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COMPILE_CPU_OPTIONS = -march=core2
77
COMPILE_DEBUG_OPTIONS = -g
88
COMPILE_OPTIMIZATION_OPTIONS = -O3 -fomit-frame-pointer -ffast-math -fno-math-errno -fno-strict-aliasing
99
COMPILE_WARN_OPTIONS = -Wall -Wno-unused-value -Wno-unused
10-
COMPILE_OPTIONS = $(COMPILE_CPU_OPTIONS) $(COMPILE_DEBUG_OPTIONS) $(COMPILE_OPTIMIZATION_OPTIONS) $(COMPILE_WARN_OPTIONS)
10+
COMPILE_OPTIONS = -std=c++11 $(COMPILE_CPU_OPTIONS) $(COMPILE_DEBUG_OPTIONS) $(COMPILE_OPTIMIZATION_OPTIONS) $(COMPILE_WARN_OPTIONS)
1111

1212
LINKER_OPTIONS = -lpthread -g
1313

0 commit comments

Comments
 (0)