cmake: disable LTO when building pmdk

See-also: https://tracker.ceph.com/issues/54473
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
Kefu Chai 2022-08-04 13:09:11 +08:00
parent 9f00a70232
commit 2a97033ba8

View File

@ -29,11 +29,12 @@ function(build_pmdk enable_ndctl)
set(PMDK_LIB_DIR "nondebug")
endif()
set(pmdk_cflags "-Wno-error -fno-lto")
include(ExternalProject)
ExternalProject_Add(pmdk_ext
${source_dir_args}
CONFIGURE_COMMAND ""
BUILD_COMMAND ${make_cmd} CC=${CMAKE_C_COMPILER} EXTRA_CFLAGS=-Wno-error NDCTL_ENABLE=${ndctl} BUILD_EXAMPLES=n BUILD_BENCHMARKS=n DOC=n
BUILD_COMMAND ${make_cmd} CC=${CMAKE_C_COMPILER} "EXTRA_CFLAGS=${pmdk_cflags}" NDCTL_ENABLE=${ndctl} BUILD_EXAMPLES=n BUILD_BENCHMARKS=n DOC=n
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS "<SOURCE_DIR>/src/${PMDK_LIB_DIR}/libpmem.a" "<SOURCE_DIR>/src/${PMDK_LIB_DIR}/libpmemobj.a"
INSTALL_COMMAND "")