mirror of
https://github.com/MariaDB/server.git
synced 2025-11-28 17:36:30 +03:00
CMakeLists.txt:
1. add -DSAFEMALLOC -DSAFE_MUTEX in the top-level CMakeLists.txt
don't force plugins to copy-paste these lines in their CMakeLists.txt
2.1 search plugin/* for plugins (not only storage/*),
2.2 recognize MYSQL_PLUGIN (not only MYSQL_STORAGE_ENGINE),
2.3 extract library names from the plug.in (don't force library names to
be ha_<engine>.dll and <engine>.lib)
include/mysql/plugin.h:
define MYSQL_PLUGIN_EXPORT appropriately
(backport from 5.5)
libmysqld/CMakeLists.txt:
remove unnecessary workaround
plugin/fulltext/CMakeLists.txt:
build fulltext example plugin on windows
storage/maria/CMakeLists.txt:
The library is called libmaria_s.lib, not maria.lib
storage/maria/unittest/CMakeLists.txt:
The library is called libmaria_s.lib, not maria.lib
storage/myisam/CMakeLists.txt:
The library is called libmyisam_s.lib, not myisam.lib
storage/mysql_storage_engine.cmake:
introduce MYSQL_PLUGIN macro.
don't force library names to be ha_<engine>.dll and <engine>.lib
storage/xtradb/CMakeLists.txt:
remove a condition from include
win/README:
don't use deprecated syntax
win/configure-mariadb.sh:
don't use deprecated syntax
win/configure.js:
1. support MYSQL_PLUGIN in addition to MYSQL_STORAGE_ENGINE.
2. support plugin/* in addition to storage/*
50 lines
1.9 KiB
CMake
50 lines
1.9 KiB
CMake
# MYSQL_STORAGE_ENGINE Macro creates a project to build storage engine
|
|
# library.
|
|
#
|
|
# Parameters:
|
|
# engine - storage engine name.
|
|
# variable ENGINE_BUILD_TYPE should be set to "STATIC" or "DYNAMIC"
|
|
# Remarks:
|
|
# ${engine}_SOURCES variable containing source files to produce the library must set before
|
|
# calling this macro
|
|
# ${engine}_LIBS variable containing extra libraries to link with may be set
|
|
|
|
|
|
MACRO(MYSQL_PLUGIN engine)
|
|
IF(NOT SOURCE_SUBLIBS)
|
|
# Add common include directories
|
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
|
STRING(TOUPPER ${engine} engine)
|
|
IF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
|
|
ADD_LIBRARY(${${engine}_LIB} ${${engine}_SOURCES})
|
|
ADD_DEPENDENCIES(${${engine}_LIB} GenError)
|
|
IF(${engine}_LIBS)
|
|
TARGET_LINK_LIBRARIES(${${engine}_LIB} ${${engine}_LIBS})
|
|
ENDIF(${engine}_LIBS)
|
|
MESSAGE("build ${engine} as static library (${${engine}_LIB}.lib)")
|
|
ELSEIF(${ENGINE_BUILD_TYPE} STREQUAL "DYNAMIC")
|
|
ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN)
|
|
ADD_LIBRARY(${${engine}_LIB} SHARED ${${engine}_SOURCES})
|
|
TARGET_LINK_LIBRARIES (${${engine}_LIB} mysqld)
|
|
IF(${engine}_LIBS)
|
|
TARGET_LINK_LIBRARIES(${${engine}_LIB} ${${engine}_LIBS})
|
|
ENDIF(${engine}_LIBS)
|
|
# Install the plugin
|
|
INSTALL(TARGETS ${${engine}_LIB} DESTINATION lib/plugin COMPONENT runtime)
|
|
MESSAGE("build ${engine} as DLL (${${engine}_LIB}.dll)")
|
|
ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
|
|
ENDIF(NOT SOURCE_SUBLIBS)
|
|
ENDMACRO(MYSQL_PLUGIN)
|
|
|
|
MACRO(MYSQL_STORAGE_ENGINE engine)
|
|
IF(NOT SOURCE_SUBLIBS)
|
|
MYSQL_PLUGIN(${engine})
|
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/sql
|
|
${CMAKE_SOURCE_DIR}/regex
|
|
${CMAKE_SOURCE_DIR}/extra/yassl/include)
|
|
IF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
|
|
ADD_DEFINITIONS(-DWITH_${engine}_STORAGE_ENGINE -DMYSQL_SERVER)
|
|
ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
|
|
ENDIF(NOT SOURCE_SUBLIBS)
|
|
ENDMACRO(MYSQL_STORAGE_ENGINE)
|