Commit 805136fd authored by Magnus Blåudd's avatar Magnus Blåudd

Bug #47797 CMake, engine can't specify additional libraries to link with

 - Make it possible for the CmakeLists.txt files in an engine to use
   ${engine}_LIBS to set additional libraries to link with
 Example: NDBCLUSTER_LIBS = ndbclient
parent 0b1fdf0b
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
# Remarks: # Remarks:
# ${engine}_SOURCES variable containing source files to produce the library must set before # ${engine}_SOURCES variable containing source files to produce the library must set before
# calling this macro # calling this macro
# ${engine}_LIBS variable containing extra libraries to link with may be set
MACRO(MYSQL_STORAGE_ENGINE engine) MACRO(MYSQL_STORAGE_ENGINE engine)
IF(NOT SOURCE_SUBLIBS) IF(NOT SOURCE_SUBLIBS)
...@@ -22,6 +24,9 @@ IF(NOT SOURCE_SUBLIBS) ...@@ -22,6 +24,9 @@ IF(NOT SOURCE_SUBLIBS)
#Create static library. The name of the library is <storage_engine>.lib #Create static library. The name of the library is <storage_engine>.lib
ADD_LIBRARY(${libname} ${${engine}_SOURCES}) ADD_LIBRARY(${libname} ${${engine}_SOURCES})
ADD_DEPENDENCIES(${libname} GenError) ADD_DEPENDENCIES(${libname} GenError)
IF(${engine}_LIBS)
TARGET_LINK_LIBRARIES(${libname} ${${engine}_LIBS})
ENDIF(${engine}_LIBS)
MESSAGE("build ${engine} as static library") MESSAGE("build ${engine} as static library")
ELSEIF(${ENGINE_BUILD_TYPE} STREQUAL "DYNAMIC") ELSEIF(${ENGINE_BUILD_TYPE} STREQUAL "DYNAMIC")
ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN) ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN)
...@@ -30,6 +35,9 @@ IF(NOT SOURCE_SUBLIBS) ...@@ -30,6 +35,9 @@ IF(NOT SOURCE_SUBLIBS)
SET(dyn_libname ha_${libname}) SET(dyn_libname ha_${libname})
ADD_LIBRARY(${dyn_libname} SHARED ${${engine}_SOURCES}) ADD_LIBRARY(${dyn_libname} SHARED ${${engine}_SOURCES})
TARGET_LINK_LIBRARIES (${dyn_libname} mysqld) TARGET_LINK_LIBRARIES (${dyn_libname} mysqld)
IF(${engine}_LIBS)
TARGET_LINK_LIBRARIES(${dyn_libname} ${${engine}_LIBS})
ENDIF(${engine}_LIBS)
MESSAGE("build ${engine} as DLL") MESSAGE("build ${engine} as DLL")
ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC") ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
ENDIF(NOT SOURCE_SUBLIBS) ENDIF(NOT SOURCE_SUBLIBS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment