better disable lto for libmysqld_exports.cc

e.g. also when -flto is set in CMAKE_CXX_FLAGS_RELWITHDEBINFO
This commit is contained in:
Sergei Golubchik 2023-11-05 19:05:16 +01:00
parent bfa15f9b34
commit 3e3fdb25f1

View file

@ -89,7 +89,7 @@ MACRO(CREATE_EXPORTS_FILE VAR TARGET API_FUNCTIONS)
CONFIGURE_FILE_CONTENT(${CONTENT} ${EXPORTS})
# Avoid "function redeclared as variable" error
# when using gcc/clang option -flto(link time optimization)
IF(" ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} " MATCHES " -flto")
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
SET_SOURCE_FILES_PROPERTIES(${EXPORTS} PROPERTIES COMPILE_FLAGS "-fno-lto")
ENDIF()
SET(${VAR} ${EXPORTS})