mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Fix LTO (aka interprocedural optimization) build with MSVC
Also, disable MSVC LTO for static client libraries - they won't be usable for end-users.
This commit is contained in:
parent
040069f4ba
commit
e87a175b3a
2 changed files with 13 additions and 0 deletions
|
@ -370,5 +370,11 @@ ENDFUNCTION()
|
|||
FUNCTION (MAYBE_DISABLE_IPO target)
|
||||
IF(MSVC AND NOT CLANG_CL)
|
||||
SET_TARGET_PROPERTIES(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF)
|
||||
IF(CMAKE_CONFIGURATION_TYPES)
|
||||
FOREACH(cfg ${CMAKE_CONFIGURATION_TYPES})
|
||||
STRING(TOUPPER "${cfg}" cfg_upper)
|
||||
SET_TARGET_PROPERTIES(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_${cfg_upper} OFF)
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
|
|
|
@ -40,6 +40,13 @@ SET(CLIENT_PLUGIN_PVIO_SOCKET STATIC)
|
|||
MESSAGE("== Configuring MariaDB Connector/C")
|
||||
ADD_SUBDIRECTORY(libmariadb)
|
||||
|
||||
IF(MSVC AND TARGET mariadb_obj AND TARGET mariadbclient)
|
||||
# With MSVC, do not produce LTCG-compiled static client libraries.
|
||||
# They are not usable by end-users, being tied to exact compiler version
|
||||
MAYBE_DISABLE_IPO(mariadb_obj)
|
||||
MAYBE_DISABLE_IPO(mariadbclient)
|
||||
ENDIF()
|
||||
|
||||
IF(UNIX)
|
||||
INSTALL(CODE "EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR})
|
||||
|
|
Loading…
Reference in a new issue