From 1f2c7aae9fdd39a478944ccda5c9e82d76ab5db6 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 1 Sep 2017 13:59:25 +0200 Subject: o Renaming SampleOutputStream to SampleConsumer. o Some c++ style fixes. --- CMakeLists.txt | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9da7eb6..8c64151 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,18 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") -IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE Debug CACHE STRING - "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." - FORCE) -ENDIF(NOT CMAKE_BUILD_TYPE) +if (NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE Debug CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) +endif (NOT CMAKE_BUILD_TYPE) + +if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto") +endif () +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto") +endif () # Boost set(Boost_USE_STATIC_LIBS OFF) @@ -37,8 +44,8 @@ if (DOXYGEN_FOUND) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating documentation" VERBATIM) - add_custom_target(doc DEPENDS ${doxy_html_index_file} ) -endif(DOXYGEN_FOUND) + add_custom_target(doc DEPENDS ${doxy_html_index_file}) +endif (DOXYGEN_FOUND) add_subdirectory(ble) add_subdirectory(apps) -- cgit v1.2.3