fix linker warning and add lto example as comment

This commit is contained in:
2022-11-06 15:31:38 +01:00
parent 3f03bbbd49
commit 20dd451cd0
2 changed files with 14 additions and 6 deletions

View File

@ -20,9 +20,16 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# add this to your projects cmake to enable ipo
#include(CheckIPOSupported)
#check_ipo_supported()
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
#if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
#include(CheckIPOSupported)
#check_ipo_supported(RESULT HAVE_LTO)
#if(HAVE_LTO)
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
#message(STATUS "Enabled LTO")
#else()
#message(STATUS "LTO not supported")
#endif()
#endif()
# enable test
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)