summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-06-06 19:56:51 +0200
committerPetr Mrázek <peterix@gmail.com>2015-06-06 19:56:51 +0200
commit678da0b639603295169d4b15988ea0832a9f2e95 (patch)
treebb3742c6e3355537a7ca79380faeb699470ac183
parentdb69a3dacd82ff364cbf85d3218006392d09965f (diff)
downloadMultiMC-678da0b639603295169d4b15988ea0832a9f2e95.tar
MultiMC-678da0b639603295169d4b15988ea0832a9f2e95.tar.gz
MultiMC-678da0b639603295169d4b15988ea0832a9f2e95.tar.lz
MultiMC-678da0b639603295169d4b15988ea0832a9f2e95.tar.xz
MultiMC-678da0b639603295169d4b15988ea0832a9f2e95.zip
GH-1052 switch over to C++14 everywhere
-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