@@ -197,9 +197,9 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
197
197
# without necessity.E.g source modifications, that do not
198
198
# change list of exported symbols, will not result in a relink for plugins.
199
199
200
- SET (MYSQLD_DEF ${CMAKE_CURRENT_BINARY_DIR} /mysqld_lib.def )
201
- SET (MYSQLD_EXP ${CMAKE_CURRENT_BINARY_DIR} /mysqld_lib.exp )
202
- SET (MYSQLD_LIB ${CMAKE_CURRENT_BINARY_DIR} /mysqld_lib.lib )
200
+ SET (MYSQLD_DEF ${CMAKE_CURRENT_BINARY_DIR} /mysqld_lib${CMAKE_CFG_INTDIR} .def )
201
+ SET (MYSQLD_EXP ${CMAKE_CURRENT_BINARY_DIR} /mysqld_lib${CMAKE_CFG_INTDIR} .exp )
202
+ SET (MYSQLD_LIB ${CMAKE_CURRENT_BINARY_DIR} /mysqld_lib${CMAKE_CFG_INTDIR} .lib )
203
203
SET (MYSQLD_CORELIBS sql mysys dbug strings )
204
204
FOREACH (CORELIB ${MYSQLD_CORELIBS} )
205
205
GET_TARGET_PROPERTY (LOC ${CORELIB} LOCATION )
@@ -214,12 +214,12 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
214
214
# Create a cmake script to generate import and export libs
215
215
# from a .def file
216
216
SET (CMAKE_CONFIGURABLE_FILE_CONTENT "
217
- IF ((mysqld_lib.def IS_NEWER_THAN mysqld_lib.lib) OR
218
- (mysqld_lib.def IS_NEWER_THAN mysqld_lib.exp))
219
- FILE(REMOVE mysqld_lib.lib mysqld_lib.exp)
217
+ IF ((mysqld_lib\$ {CFG} .def IS_NEWER_THAN mysqld_lib\$ {CFG} .lib) OR
218
+ (mysqld_lib\$ {CFG} .def IS_NEWER_THAN mysqld_lib\$ {CFG} .exp))
219
+ FILE(REMOVE mysqld_lib\$ {CFG} .lib mysqld_lib\$ {CFG} .exp)
220
220
SET(ENV{VS_UNICODE_OUTPUT})
221
221
EXECUTE_PROCESS (
222
- COMMAND \" ${CMAKE_LINKER} \" /lib /NAME:mysqld.exe \" /DEF:${MYSQLD_DEF} \" /MACHINE:${_PLATFORM}
222
+ COMMAND \" ${CMAKE_LINKER} \" /lib /NAME:mysqld.exe \" /DEF:${CMAKE_CURRENT_BINARY_DIR} /mysqld_lib \$ {CFG}.def \" /MACHINE:${_PLATFORM}
223
223
RESULT_VARIABLE ret)
224
224
IF(NOT ret EQUAL 0)
225
225
MESSAGE(FATAL_ERROR \" process failed ret=\$ {ret}\" )
@@ -229,41 +229,22 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
229
229
230
230
CONFIGURE_FILE (
231
231
${PROJECT_SOURCE_DIR} /cmake/configurable_file_content.in
232
- make_mysqld_lib.cmake )
232
+ make_mysqld_lib.cmake
233
+ @ONLY )
233
234
234
235
IF (CMAKE_VERSION VERSION_GREATER "3.2.0" )
235
236
SET (MYSQLD_LIB_BYPRODUCTS BYPRODUCTS ${MYSQLD_DEF} ${MYSQLD_LIB} ${MYSQLD_EXP} )
236
237
ENDIF ()
237
238
238
- # Create a cmake script to generate import and export libs
239
- # from a .def file
240
- SET (CMAKE_CONFIGURABLE_FILE_CONTENT "
241
- IF ((mysqld_lib.def IS_NEWER_THAN mysqld_lib.lib) OR
242
- (mysqld_lib.def IS_NEWER_THAN mysqld_lib.exp))
243
- FILE(REMOVE mysqld_lib.lib mysqld_lib.exp)
244
- SET(ENV{VS_UNICODE_OUTPUT})
245
- EXECUTE_PROCESS (
246
- COMMAND \" ${CMAKE_LINKER} \" /lib /NAME:mysqld.exe \" /DEF:${MYSQLD_DEF} \" /MACHINE:${_PLATFORM}
247
- RESULT_VARIABLE ret)
248
- IF(NOT ret EQUAL 0)
249
- MESSAGE(FATAL_ERROR \" process failed ret=\$ {ret}\" )
250
- ENDIF()
251
- ENDIF()
252
- " )
253
-
254
- CONFIGURE_FILE (
255
- ${PROJECT_SOURCE_DIR} /cmake/configurable_file_content.in
256
- make_mysqld_lib.cmake )
257
-
258
239
ADD_CUSTOM_COMMAND (
259
240
OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /mysqld_lib.stamp
260
241
${MYSQLD_LIB_BYPRODUCTS}
261
- COMMENT "Generating mysqld_lib.def, mysqld_lib.lib, mysqld_lib.exp "
242
+ COMMENT "Generating ${MYSQLD_DEF} , ${MYSQLD_LIB} , ${MYSQLD_EXP} "
262
243
COMMAND cscript //nologo ${PROJECT_SOURCE_DIR} /win/create_def_file.js
263
- ${_PLATFORM} /forLib ${LIB_LOCATIONS} > mysqld_lib.def .tmp
264
- COMMAND ${CMAKE_COMMAND} -E copy_if_different mysqld_lib.def. tmp mysqld_lib.def
265
- COMMAND ${CMAKE_COMMAND} -E remove mysqld_lib.def .tmp
266
- COMMAND ${CMAKE_COMMAND} -P make_mysqld_lib.cmake
244
+ ${_PLATFORM} /forLib ${LIB_LOCATIONS} > ${MYSQLD_DEF} .tmp
245
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MYSQLD_DEF} . tmp ${MYSQLD_DEF}
246
+ COMMAND ${CMAKE_COMMAND} -E remove ${MYSQLD_DEF} .tmp
247
+ COMMAND ${CMAKE_COMMAND} "-DCFG= ${CMAKE_CFG_INTDIR} " -P make_mysqld_lib.cmake
267
248
COMMAND ${CMAKE_COMMAND} -E touch mysqld_lib.stamp
268
249
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
269
250
DEPENDS ${MYSQLD_CORELIBS}
0 commit comments