mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Optionally use newer cmake features.
So we can keep supporting cmake 2.8.12, which is the version on ubuntu trusty.
This commit is contained in:
parent
721358208b
commit
c09917c6a7
|
@ -14,8 +14,8 @@
|
|||
#
|
||||
################################################################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.1.0)
|
||||
cmake_policy(VERSION 3.1.0)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_policy(VERSION 2.8.12)
|
||||
project(toxcore)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${toxcore_SOURCE_DIR}/cmake)
|
||||
|
@ -66,14 +66,19 @@ enable_testing()
|
|||
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
|
||||
# Set standard version for compiler.
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
|
||||
add_cflag("-std=c99")
|
||||
add_cxxflag("-std=c++11")
|
||||
else()
|
||||
# Set standard version for compiler.
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
message(STATUS "Supported C compiler features = ${CMAKE_C_COMPILE_FEATURES}")
|
||||
message(STATUS "Supported C++ compiler features = ${CMAKE_CXX_COMPILE_FEATURES}")
|
||||
message(STATUS "Supported C compiler features = ${CMAKE_C_COMPILE_FEATURES}")
|
||||
message(STATUS "Supported C++ compiler features = ${CMAKE_CXX_COMPILE_FEATURES}")
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
# Warn on non-ISO C.
|
||||
|
|
Loading…
Reference in New Issue
Block a user