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

Windows - Fix CMAKE_INTERPROCEDURAL_OPTIMIZATION build with MSVC

If IPO is enabled, MSVC compiles with /GL  which is not
compatible with cmake's WINDOWS_EXPORT_ALL_SYMBOLS.

Since server.dll can't autoexport symbols from /GL compiled objects,
IPO must be disabled for dbug, string,mysys, and sql targets (in case we
build "plugin" DLLs that need server.dll's symbols)
This commit is contained in:
Vladislav Vaintroub
2021-05-09 23:45:24 +02:00
parent f33e8e4a95
commit bc64a03c3a
4 changed files with 29 additions and 12 deletions

View File

@@ -368,7 +368,12 @@ ENDFUNCTION()
# for some static libraries.
FUNCTION (MAYBE_DISABLE_IPO target)
IF(MSVC AND NOT CLANG_CL)
SET_TARGET_PROPERTIES(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF)
IF(MSVC AND (NOT CLANG_CL) AND (NOT WITHOUT_DYNAMIC_PLUGINS))
SET_TARGET_PROPERTIES(${target} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION OFF
INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF
INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO OFF
INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF)
ENDIF()
ENDFUNCTION()