如何编译mysql-server示例插件

时间:2018-05-16 08:56:19

标签: mysql plugins cmake

我想为mysql编写一个信息架构插件,首先我试图编译示例插件并出现一些错误。 CmakeList.txt是这样的:

MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc
MODULE_ONLY TEST_ONLY MODULE_OUTPUT_NAME "libdaemon_example")

INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Test)

据说是未知的Cmake命令" MYSQL_ADD_PLUGIN",

Selecting Windows SDK version 10.0.16299.0 to target Windows 6.1.7601.
The C compiler identification is MSVC 19.11.25547.0
The CXX compiler identification is MSVC 19.11.25547.0
Check for working C compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe
Check for working C compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe
Check for working CXX compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:16 (MYSQL_ADD_PLUGIN):
  Unknown CMake command "MYSQL_ADD_PLUGIN".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.11)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".

此警告适用于项目开发人员。使用-Wno-dev来抑制它。

Configuring incomplete, errors occurred!
See also "C:/Program Files/CMake/bin/CMakeFiles/CMakeOutput.log".

我发现这个函数在mysql-server \ cmake文件中,

MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;CLIENT_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_FOR_EMBEDDED;RECOMPILE_FOR_EMBEDDED;TEST_ONLY"
${ARGN}
)

我想知道如何解决它并使编译成功? error image

0 个答案:

没有答案