1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-22454

Disable IPO (interprocedural optimization, aka /GL) on Windows
on libraries, from which server.dll exports symbols -  exporting symbols
does not work for objects compiled with /GL.
This commit is contained in:
Vladislav Vaintroub
2020-05-04 14:17:06 +02:00
parent f544a712c8
commit d50f776930
6 changed files with 22 additions and 3 deletions

View File

@@ -330,3 +330,15 @@ FUNCTION(RESTRICT_SYMBOL_EXPORTS target)
COMPILE_FLAGS "${COMPILE_FLAGS} ${VISIBILITY_HIDDEN_FLAG}")
ENDIF()
ENDFUNCTION()
# The MSVC /GL flag, used for link-time code generation
# creates objects files with a format not readable by tools
# i.e exporting all symbols is not possible with IPO
# To workaround this, we disable INTERPROCEDURAL_OPTIMIZATION
# for some static libraries.
FUNCTION (MAYBE_DISABLE_IPO target)
IF(MSVC AND NOT CLANG_CL)
SET_TARGET_PROPERTIES(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF)
ENDIF()
ENDFUNCTION()