Browse Source

- enabled LTO if supported

development
Andreas Romeyke 11 months ago
parent
commit
ae8ee0474b
  1. 12
      src/CMakeLists.txt

12
src/CMakeLists.txt

@ -1,9 +1,11 @@
cmake_minimum_required (VERSION 2.6)
cmake_minimum_required (VERSION 3.9.4)
project (checkit_tiff)
include_directories("${PROJECT_SOURCE_DIR}/headers")
include_directories("${PROJECT_SOURCE_DIR}/validate_icc")
include (CheckSymbolExists)
include (CheckFunctionExists)
include(CheckIPOSupported)
file( GLOB checkit_tiff_SOURCES
"${PROJECT_SOURCE_DIR}/tagrules/*.c"
@ -49,6 +51,14 @@ else()
message(STATUS "Your compiler (${CMAKE_C_COMPILER}) has no gnu11 support. If you are using clang on Apple OS X, please switch to gcc (version > 4.7) which is compliant with the C11 standard.")
endif()
check_ipo_supported(RESULT LTO_IS_SUPPORTED OUTPUT LTO_CHECK_ERROR)
if (LTO_IS_SUPPORTED)
message(STATUS "IPO / LTO enabled")
SET(INTERPROCEDURAL_OPTIMIZATIONS TRUE)
else()
message(STATUS "IPO / LTO unsupported: <${LTO_CHECK_ERROR}>")
endif()
if(WIN32)
add_definitions(-D__WIN32__=1)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")

Loading…
Cancel
Save