summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Castelli <florent.castelli@gmail.com>2017-01-20 17:44:23 +0100
committerFlorent Castelli <florent.castelli@gmail.com>2017-01-20 17:46:40 +0100
commit4785802b9e972a09014e2713d7300a2be369fb82 (patch)
tree31d747d6371713bc9acbf59d135473877fdd26e2
parent25c779943b5646fbdc831f93ee45887b6c333369 (diff)
cmake: Move C++ standard requirement out of global scope to Source/
-rw-r--r--CMakeLists.txt10
-rw-r--r--Source/CMakeLists.txt10
2 files changed, 10 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a167ab78c..81c1304ad6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1057,16 +1057,6 @@ enable_testing()
add_custom_target(unittests)
add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND})
-
-########################################
-# Start compiling our code
-#
-add_definitions(-std=c++1y)
-
-# These aren't actually needed for C11/C++11
-# but some dependencies require them (LLVM, libav).
-add_definitions(-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS)
-
add_subdirectory(Source)
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 2cc8c77c12..46f2a9c9cc 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -1,3 +1,13 @@
+check_and_add_flag(CXX14 -std=c++14)
+if(NOT FLAG_CXX_CXX14)
+ check_and_add_flag(HAS_CXX1Y -std=c++1y)
+endif()
+
+# These aren't actually needed for C11/C++11
+# but some dependencies require them (LLVM, libav).
+add_definitions(-D__STDC_LIMIT_MACROS)
+add_definitions(-D__STDC_CONSTANT_MACROS)
+
set(CMAKE_FAKELANG_CREATE_STATIC_LIBRARY "touch <TARGET>")
if(ENABLE_PCH)
# This is actually a .h file, but trick cmake into compiling it as a source file