aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-09-01 13:59:25 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-09-01 14:06:01 +0200
commit1f2c7aae9fdd39a478944ccda5c9e82d76ab5db6 (patch)
tree691f851318c60465dd5d4c837136e991026432ff /CMakeLists.txt
parent3af4d83dfa190d8d95aefbf31ae0b1d85abe492a (diff)
downloadble-toys-1f2c7aae9fdd39a478944ccda5c9e82d76ab5db6.tar.gz
ble-toys-1f2c7aae9fdd39a478944ccda5c9e82d76ab5db6.tar.bz2
ble-toys-1f2c7aae9fdd39a478944ccda5c9e82d76ab5db6.tar.xz
ble-toys-1f2c7aae9fdd39a478944ccda5c9e82d76ab5db6.zip
o Renaming SampleOutputStream to SampleConsumer.
o Some c++ style fixes.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 14 insertions, 7 deletions
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)