From 492763fec2bb4fa9c0c52b906feda0a2a96d866c Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 28 Nov 2018 15:47:03 +0100 Subject: Build: change back link-time-optimization default to off I've found that if building PROJ with lto, but GDAL without lto, exceptions thrown in PROJ are not properly captured by try {} blocks in PROJ C API, and unexpectedly go back up to GDAL. Might be a defect of the particular compiler I use (gcc 5.4 Ubuntu 16.04) --- configure.ac | 4 ++-- src/lib_proj.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 31cb2a8a..25675d6a 100644 --- a/configure.ac +++ b/configure.ac @@ -151,10 +151,10 @@ AC_MSG_CHECKING([to enable LTO (link time optimization) build]) AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], - [enable LTO(link time optimization) (enabled by default)])) + [enable LTO(link time optimization) (disabled by default)])) FLTO_FLAG="" -if test "x$enable_lto" = "xyes" -o "x$enable_lto" = "x"; then +if test "x$enable_lto" = "xyes"; then AC_LANG_PUSH([C++]) AX_CHECK_COMPILE_FLAG([-flto], [FLTO_FLAG="-flto"],,[$ERROR_ON_UNKNOWN_OPTIONS]) if test "$FLTO_FLAG" != ""; then diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake index 6fe84944..bb45db44 100644 --- a/src/lib_proj.cmake +++ b/src/lib_proj.cmake @@ -32,7 +32,7 @@ elseif(USE_THREAD AND NOT Threads_FOUND) message(FATAL_ERROR "No thread library found and thread/mutex support is required by USE_THREAD option") endif() -option(ENABLE_LTO "Build library with LTO optimization (if available)." ON) +option(ENABLE_LTO "Build library with LTO optimization (if available)." OFF) if(ENABLE_LTO) if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") include (CheckCXXSourceCompiles) -- cgit v1.2.3