summaryrefslogtreecommitdiff
path: root/cmake/plugin.cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-04-03 18:48:48 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-04-03 18:48:48 +0000
commitf2dc04abea172e4c5d701a749902c88f4a626c2c (patch)
tree00801d28e0d4fdba73024a9ef5348b20145921e4 /cmake/plugin.cmake
parentff6f4d7db11c1b8960376de3035b9e498fac5d34 (diff)
downloadmariadb-git-f2dc04abea172e4c5d701a749902c88f4a626c2c.tar.gz
Compiling, Windows . Avoid unnecessary rebuilds with MSVC.
To export symbols from the mysqld.exe, use lib.exe with /DEF, rather than pre-link step when building mysqld.exe. This helps to avoid relinking all plugins, if mysqld.exe was recompiled but the list of its exports has not changed. Also removed unnecessary DEPENDS in some ADD_CUSTOM_COMMAND (gen_lex_token, gen_lex_hash etc). They confuse VS generator which tends to recreate headers and do unnecessary recompilations.
Diffstat (limited to 'cmake/plugin.cmake')
-rw-r--r--cmake/plugin.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index e1d2af2add6..ba7bac837b1 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -179,8 +179,15 @@ MACRO(MYSQL_ADD_PLUGIN)
# executable to the linker command line (it would result into link error).
# Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
# an additional dependency.
- IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
- TARGET_LINK_LIBRARIES (${target} mysqld ${ARG_LINK_LIBRARIES})
+ IF(MSVC)
+ ADD_DEPENDENCIES(${target} gen_mysqld_lib)
+ TARGET_LINK_LIBRARIES(${target} mysqld_import_lib)
+ ELSEIF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ TARGET_LINK_LIBRARIES (${target} mysqld)
+ ENDIF()
+
+ IF(ARG_LINK_LIBRARIES)
+ TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES})
ENDIF()
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})