Skip to content
Permalink
Browse files

Enable C++11 by default

  • Loading branch information
m-kuhn committed Oct 20, 2016
1 parent 8064148 commit a6a4f2edba41ebbe2d9fd7507d7204eac5018393
Showing with 2 additions and 17 deletions.
  1. +2 −17 CMakeLists.txt
@@ -346,23 +346,8 @@ FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
# or definitely Apple LLVM 5.0 (based on LLVM 3.3svn, in Xcode 5+):
# https://gist.github.com/yamaya/2924292

IF (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
IF (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
SET(USE_CXX_11 TRUE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ENDIF()
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
IF ((NOT APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.2")
OR (APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.1"))
SET(USE_CXX_11 TRUE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-error=c++11-narrowing")
ENDIF()
ELSEIF (MSVC AND MSVC_VERSION GREATER 1600)
SET(USE_CXX_11 TRUE)
ELSE()
SET(USE_CXX_11 FALSE)
ENDIF()
SET(CMAKE_CXX_STANDARD 11)
SET(USE_CXX_11 TRUE)

#allow override keyword if available
IF(NOT USE_CXX_11)

This comment has been minimized.

Copy link
@3nids

3nids Oct 20, 2016

Member

I suppose this can be removed too?

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Oct 20, 2016

Author Member

done, thx

1 comment on commit a6a4f2e

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson commented on a6a4f2e Oct 20, 2016

Yay!

Please sign in to comment.
You can’t perform that action at this time.