mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
refactor: remove scripts for old version of cmake
now minimum_require ensures that version is not used
This commit is contained in:
@@ -12,7 +12,6 @@ option(TOML11_USE_UNRELEASED_TOML_FEATURES
|
|||||||
"use features in toml-lang/toml master while testing" OFF)
|
"use features in toml-lang/toml master while testing" OFF)
|
||||||
|
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
if("${CMAKE_VERSION}" VERSION_GREATER 3.1)
|
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Boolean specifying whether compiler specific extensions are requested.")
|
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Boolean specifying whether compiler specific extensions are requested.")
|
||||||
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
||||||
message(FATAL_ERROR "CMAKE_CXX_STANDARD is not defined. \
|
message(FATAL_ERROR "CMAKE_CXX_STANDARD is not defined. \
|
||||||
@@ -20,30 +19,6 @@ The C++ standard whose features are requested to *build* all targets. \
|
|||||||
Remember that toml11 is a header only library that does NOT require compilation to use.")
|
Remember that toml11 is a header only library that does NOT require compilation to use.")
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "Boolean describing whether the value of CXX_STANDARD is a requirement.")
|
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "Boolean describing whether the value of CXX_STANDARD is a requirement.")
|
||||||
else()
|
|
||||||
# Manually check for C++11 compiler flag.
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=gnu++11" COMPILER_SUPPORTS_GNU11)
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=gnu++0x" COMPILER_SUPPORTS_GNU0X)
|
|
||||||
if(COMPILER_SUPPORTS_CXX11)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
||||||
elseif(COMPILER_SUPPORTS_CXXOX)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
||||||
elseif(COMPILER_SUPPORTS_GNU11)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
|
||||||
elseif(COMPILER_SUPPORTS_GNU0X)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
|
|
||||||
else()
|
|
||||||
if(MSVC)
|
|
||||||
if(MSVC_VERSION LESS 1900)
|
|
||||||
message(SEND_ERROR "MSVC < 14.0 is not supported. Please update your compiler or use mingw")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
message(SEND_ERROR "The ${CMAKE_CXX_COMPILER} compiler lacks C++11 support. Use another compiler.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# add_definitions("/Zc:__cplusplus") # define __cplusplus value correctly
|
# add_definitions("/Zc:__cplusplus") # define __cplusplus value correctly
|
||||||
|
Reference in New Issue
Block a user