]> git.lyx.org Git - features.git/commitdiff
Cmake build: Remove warnings about deprecated policy CMP0069
authorKornel Benko <kornel@lyx.org>
Sat, 9 Nov 2019 15:56:16 +0000 (16:56 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:46 +0000 (15:48 +0200)
Deprecated since cmake version 3.16
(Now explicitly enable/disable interprocedural optimization
if supported and not debugging)

3rdparty/hunspell/CMakeLists.txt
3rdparty/libiconv/CMakeLists.txt
3rdparty/mythes/CMakeLists.txt
3rdparty/zlib/CMakeLists.txt
CMakeLists.txt
src/CMakeLists.txt
src/tex2lyx/CMakeLists.txt

index ad67b438654bdfa2b44f0866395f6471f332d64c..9921d6d88a3fa4ac46fad34e61e6e302ea51166d 100644 (file)
@@ -1,11 +1,12 @@
 
 cmake_minimum_required(VERSION 3.1)
 
+set(LYX_IPO_SUPPORTED FALSE)
 if (POLICY CMP0069)
-  if (LYX_DEBUG)
-    cmake_policy(SET CMP0069 OLD)
-  else()
+  if (NOT LYX_DEBUG)
     cmake_policy(SET CMP0069 NEW)
+    include(CheckIPOSupported)
+    check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
   endif()
 endif()
 
@@ -61,4 +62,6 @@ set(HUNSPELL_LIBRARY hunspell CACHE STRING "Hunspell library" FORCE)
 set(HUNSPELL_INCLUDE_DIR ${SRCDIR} CACHE STRING "Hunspell include dir" FORCE)
 set(HUNSPELL_FOUND CACHE STRING "Hunspell found" FORCE)
 
-set_target_properties(hunspell PROPERTIES FOLDER "3rd_party")
+set_target_properties(hunspell PROPERTIES
+       FOLDER "3rd_party"
+       INTERPROCEDURAL_OPTIMIZATION ${LYX_IPO_SUPPORTED})
index 7f5c73bf7f67c75012267fb7bf9099afa4adcc45..6261b3cb30fe940a86fc991ddfe20c75b4cf7404 100644 (file)
@@ -7,8 +7,13 @@
 project ( libiconv C )
 cmake_minimum_required(VERSION 3.1)
 
+set(LYX_IPO_SUPPORTED FALSE)
 if (POLICY CMP0069)
-  cmake_policy(SET CMP0069 NEW)
+  if (NOT LYX_DEBUG)
+    cmake_policy(SET CMP0069 NEW)
+    include(CheckIPOSupported)
+    check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
+  endif()
 endif()
 
 set(CMAKE_MODULE_PATH .)
@@ -59,4 +64,6 @@ set(ICONV_INCLUDE_DIR ${BINDIR}/include CACHE STRING "libiconv include  dir" FOR
 set(ICONV_LIBRARY iconv CACHE STRING "libiconv library" FORCE)
 set(ICONV_FOUND iconv CACHE STRING "libiconv found" FORCE)
 
-set_target_properties(iconv PROPERTIES FOLDER "3rd_party")
+set_target_properties(iconv PROPERTIES
+       FOLDER "3rd_party"
+       INTERPROCEDURAL_OPTIMIZATION ${LYX_IPO_SUPPORTED})
index d970ef23c337abc3d03ff4d07efe289ec1223a41..1b224a9d4c303e3c8ea0196328a6a560fa42f79a 100644 (file)
@@ -1,10 +1,11 @@
 cmake_minimum_required(VERSION 3.1)
 
+set(LYX_IPO_SUPPORTED FALSE)
 if (POLICY CMP0069)
-  if (LYX_DEBUG)
-    cmake_policy(SET CMP0069 OLD)
-  else()
+  if (NOT LYX_DEBUG)
     cmake_policy(SET CMP0069 NEW)
+    include(CheckIPOSupported)
+    check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
   endif()
 endif()
 
@@ -27,4 +28,6 @@ set(MYTHESLIB_LIBRARY mytheslibstatic CACHE STRING "Mytheslib library" FORCE)
 set(MYTHESLIB_INCLUDE_DIR  ${SRCDIR} CACHE STRING "Mytheslib include dir" FORCE)
 set(MYTHESLIB_FOUND CACHE STRING "Mytheslib found" FORCE )
 
-set_target_properties(mytheslibstatic PROPERTIES FOLDER "3rd_party")
+set_target_properties(mytheslibstatic PROPERTIES
+       FOLDER "3rd_party"
+       INTERPROCEDURAL_OPTIMIZATION ${LYX_IPO_SUPPORTED})
index a8ca489369aaefcf5b5eda6682ea18e31567b769..b14776ef45d4dbb6591113360556866be0cb5063 100644 (file)
@@ -1,7 +1,12 @@
 cmake_minimum_required(VERSION 3.1)
 
+set(LYX_IPO_SUPPORTED FALSE)
 if (POLICY CMP0069)
-  cmake_policy(SET CMP0069 NEW)
+  if (NOT LYX_DEBUG)
+    cmake_policy(SET CMP0069 NEW)
+    include(CheckIPOSupported)
+    check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
+  endif()
 endif()
 
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
@@ -163,4 +168,6 @@ set(ZLIB_LIBRARY zlibstatic CACHE STRING "Zlib library" FORCE)
 set(ZLIB_INCLUDE_DIR  ${SRCDIR} CACHE STRING "Zlib include dir" FORCE)
 set(ZLIB_FOUND CACHE STRING "Zlib found" FORCE )
 
-set_target_properties(zlibstatic PROPERTIES FOLDER "3rd_party")
+set_target_properties(zlibstatic PROPERTIES
+       FOLDER "3rd_party"
+       INTERPROCEDURAL_OPTIMIZATION ${LYX_IPO_SUPPORTED})
index f759d8f45bdeb314939bf5e1b75169b24cd2f2c2..779d9e932d924aec625621b23d6bae33418f8594 100644 (file)
@@ -82,11 +82,12 @@ if(NOT help AND NOT HELP)
     endif()
   endif()
   # Enable LTO if supported and not debugging
+  set(LYX_IPO_SUPPORTED FALSE)
   if (POLICY CMP0069)
-    if (LYX_DEBUG)
-      cmake_policy(SET CMP0069 OLD)
-    else()
+    if (NOT LYX_DEBUG)
       cmake_policy(SET CMP0069 NEW)
+      include(CheckIPOSupported)
+      check_ipo_supported(RESULT LYX_IPO_SUPPORTED)
     endif()
   endif()
 endif()
index 39c751f3ff285b5a8fb3d1f01fdb7fddd0ab0b5f..77931794319ad16dec83411c35f3b25929322391 100644 (file)
@@ -122,8 +122,9 @@ add_executable(${_lyx}
 
 add_dependencies(${_lyx} lyx_version)
 
-set_target_properties(${_lyx} PROPERTIES FOLDER "applications/LyX")
-
+set_target_properties(${_lyx} PROPERTIES
+       FOLDER "applications/LyX"
+       INTERPROCEDURAL_OPTIMIZATION ${LYX_IPO_SUPPORTED})
 lyx_add_gcc_pch(${_lyx})
 
 target_link_libraries(${_lyx}
index 36db7234dffb9b88df89a8ece80c1f8fddf7b7c2..1927655c7f7fffc1ee1d80cf3663f13d19461321 100644 (file)
@@ -40,7 +40,9 @@ else()
        lyx_const_touched_files(_allinone_linked  LINKED_sources)
        add_executable(${_tex2lyx} ${_allinone_files} ${_allinone_linked_files} ${FILE_RC})
 endif()
-set_target_properties(${_tex2lyx} PROPERTIES FOLDER "applications/TeX2LyX")
+set_target_properties(${_tex2lyx} PROPERTIES
+       FOLDER "applications/TeX2LyX"
+       INTERPROCEDURAL_OPTIMIZATION ${LYX_IPO_SUPPORTED})
 
 target_link_libraries(${_tex2lyx}
        support