summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry <bitomaxsp@gmail.com>2019-10-17 14:17:49 +0200
committerGitHub <noreply@github.com>2019-10-17 14:17:49 +0200
commit38945971d693250badd5faafd214bae3585971c9 (patch)
tree855f4363edc4d1f9ebd19c39481b0a70a5b38b36
parente9e11b84e629c3e06fbaa4f0a86de02ceb9d6992 (diff)
downloadsnappy-git-38945971d693250badd5faafd214bae3585971c9.tar.gz
Allow build with different standard if lib used as a subproject
-rw-r--r--CMakeLists.txt11
1 files changed, 7 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32bfd90..466faa2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,13 @@
cmake_minimum_required(VERSION 3.1)
project(Snappy VERSION 1.1.7 LANGUAGES C CXX)
-# This project requires C++11.
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
+# Allow build with different standard
+if(NOT CMAKE_CXX_STANDARD)
+ # This project requires C++11.
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ set(CMAKE_CXX_EXTENSIONS OFF)
+endif()
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make
# it prominent in the GUI.