Skip to content

Commit e461021

Browse files
committed
Forcing c++ 11 standard.
1 parent 4d9aabc commit e461021

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ SET(BIN2CPP_VERSION_PATCH 0)
102102
set(BIN2CPP_VERSION ${BIN2CPP_VERSION_MAJOR}.${BIN2CPP_VERSION_MINOR}.${BIN2CPP_VERSION_PATCH})
103103
FILE(WRITE ${CMAKE_BINARY_DIR}/version "${BIN2CPP_VERSION}")
104104

105+
# Force c++ 11
106+
# https://www.reddit.com/r/cpp_questions/comments/1d4tt8a/comment/l6gqea5/
107+
# My guess is that you are on mac and using g++ to compile. For godforsaken reasons, g++ by default is an alias to clang++ forced into some crazy C++98 mode.
108+
# https://stackoverflow.com/questions/10851247/how-do-i-activate-c-11-in-cmake
109+
set (CMAKE_CXX_STANDARD 11)
110+
set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
111+
105112
# Create a c++ file header from the project LICENSE file.
106113
# The c++ header will be added to all generated files.
107114
include(MakeCplusplusHeader)

0 commit comments

Comments
 (0)