diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-15 21:33:56 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-15 23:01:32 +0000 |
commit | 9eacfafff75c5520a0a6f16132c4ac13db24a634 (patch) | |
tree | a55a6873a5922abecf0b4ece95c867c9bcbf85af /CMakeLists.txt | |
parent | c0b4cd156f79f1c7f3ce747a27cae16a78549cc6 (diff) |
Set C++11/C99 flag manually in older cmake on not-msvc.
These flags are needed so the code actually compiles, so can't only be
set on Travis.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bbff255..c3f3d52d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -77,7 +77,12 @@ enable_testing() | |||
77 | 77 | ||
78 | set(CMAKE_MACOSX_RPATH ON) | 78 | set(CMAKE_MACOSX_RPATH ON) |
79 | 79 | ||
80 | if(NOT ${CMAKE_VERSION} VERSION_LESS "3.1.0") | 80 | if(${CMAKE_VERSION} VERSION_LESS "3.1.0") |
81 | if(NOT MSVC) | ||
82 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") | ||
83 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
84 | endif() | ||
85 | else() | ||
81 | # Set standard version for compiler. | 86 | # Set standard version for compiler. |
82 | set(CMAKE_C_STANDARD 99) | 87 | set(CMAKE_C_STANDARD 99) |
83 | set(CMAKE_CXX_STANDARD 11) | 88 | set(CMAKE_CXX_STANDARD 11) |