Skip to content

Commit f29c4ff

Browse files
committed
Use standard CMake C++11 enablement
1 parent 8052318 commit f29c4ff

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

CMakeLists.txt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,8 @@ set(tmux-mem-cpu-load_VERSION
2828
${tmux-mem-cpu-load_VERSION_MAJOR}.${tmux-mem-cpu-load_VERSION_MINOR}.${tmux-mem-cpu-load_VERSION_PATCH})
2929

3030
# Check whether we have support for c++11 in compiler and fail if we don't
31-
include(CheckCXXCompilerFlag)
32-
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
33-
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
34-
35-
if(COMPILER_SUPPORTS_CXX11)
36-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
37-
elseif(COMPILER_SUPPORTS_CXX0X)
38-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
39-
else()
40-
message(FATAL_ERROR
41-
"Compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++11 support.")
42-
endif()
31+
set(CMAKE_CXX_STANDARD 11)
32+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4333

4434
# generate header file to handle version
4535
configure_file(

0 commit comments

Comments
 (0)