summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/UseCXX14.cmake13
-rw-r--r--depends/util/CMakeLists.txt2
3 files changed, 15 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 342ddbe4..06401d04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,7 +32,7 @@ endif()
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars)
######## Set compiler flags ########
-include(UseCXX11)
+include(UseCXX14)
include(Coverage)
set(CMAKE_CXX_FLAGS " -Wall ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type")
diff --git a/cmake/UseCXX14.cmake b/cmake/UseCXX14.cmake
new file mode 100644
index 00000000..a45f3be7
--- /dev/null
+++ b/cmake/UseCXX14.cmake
@@ -0,0 +1,13 @@
+if(__USECXX14_CMAKE__)
+ return()
+endif()
+set(__USECXX14_CMAKE__ TRUE)
+
+if(APPLE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++14")
+elseif(UNIX)
+ # assume GCC, add C++0x/C++11 stuff
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
+elseif(MINGW)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
+endif()
diff --git a/depends/util/CMakeLists.txt b/depends/util/CMakeLists.txt
index 7a18067c..40adae7e 100644
--- a/depends/util/CMakeLists.txt
+++ b/depends/util/CMakeLists.txt
@@ -1,6 +1,6 @@
project(libUtil)
-include(UseCXX11)
+include(UseCXX14)
include(Coverage)
# Find Qt