Commit f20569cd authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5291 add -g -fuse-linker-plugin for link time optimization


git-svn-id: file:///svn/toku/tokudb@46102 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7467b279
......@@ -85,6 +85,8 @@ set_cflags_if_supported(
-Wmissing-format-attribute
-Wno-error=missing-format-attribute
-Wpacked
-fno-rtti
-fno-exceptions
)
## set_cflags_if_supported_named("-Weffc++" -Weffcpp)
set_ldflags_if_supported(
......@@ -108,14 +110,18 @@ else ()
check_c_compiler_flag(-flto HAVE_C_FLAG_FLTO)
check_c_compiler_flag(-ipo HAVE_C_FLAG_IPO)
if (HAVE_C_FLAG_FLTO)
set(CMAKE_C_FLAGS_RELEASE "-O3 -flto")# -fuse-linker-plugin")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto -fuse-linker-plugin")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g -fuse-linker-plugin")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -g -fuse-linker-plugin")
elseif (HAVE_C_FLAG_IPO)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ip -ipo1")
endif ()
check_cxx_compiler_flag(-flto HAVE_CXX_FLAG_FLTO)
check_cxx_compiler_flag(-ipo HAVE_CXX_FLAG_IPO)
if (HAVE_CXX_FLAG_FLTO)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -flto")# -fuse-linker-plugin")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto -fuse-linker-plugin")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g -fuse-linker-plugin")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -g -fuse-linker-plugin")
elseif (HAVE_CXX_FLAG_IPO)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ip -ipo1")
endif ()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment