diff --git a/CMakeLists.txt b/CMakeLists.txt index 6810db1..7251710 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,20 +1,15 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.2.0) project(lwmqtt) add_subdirectory(gtest/googletest) include_directories(gtest/googletest/include) +set(CMAKE_C_STANDARD 11) +set(CMAKE_CXX_STANDARD 11) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter") -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c1x -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") -else() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -endif() - include_directories(include) set(SOURCE_FILES