summaryrefslogtreecommitdiff
path: root/storage/mroonga
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-11-13 18:41:11 +0100
committerSergei Golubchik <serg@mariadb.org>2015-11-16 07:55:55 +0100
commit0c5f36d5791d40f11d95e667c2ae000c21814218 (patch)
treecce76528d10e6c323fd6bf7034e735dc232a97b4 /storage/mroonga
parent12c32bd9892efef16d170e6cc8c9633e988e7025 (diff)
downloadmariadb-git-0c5f36d5791d40f11d95e667c2ae000c21814218.tar.gz
MDEV-8969 groonga is compiled even with -DPLUGIN_MROONGA=NO
first add mroonga plugin (MYSQL_ADD_PLUGIN) then add dependent targets (add_subdirectory(groonga))
Diffstat (limited to 'storage/mroonga')
-rw-r--r--storage/mroonga/CMakeLists.txt104
1 files changed, 50 insertions, 54 deletions
diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt
index 9aa5a4bd990..5c70e14d416 100644
--- a/storage/mroonga/CMakeLists.txt
+++ b/storage/mroonga/CMakeLists.txt
@@ -51,12 +51,6 @@ if(MSVC)
endif()
endif()
-if(MRN_BUNDLED)
- if(WITHOUT_MROONGA OR WITHOUT_MROONGA_STORAGE_ENGINE)
- return()
- endif()
-endif()
-
set(MRN_BUNDLED_GROONGA_RELATIVE_DIR "vendor/groonga")
set(MRN_BUNDLED_GROONGA_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
@@ -85,44 +79,6 @@ file(READ ${MRN_SOURCE_DIR}/version_micro MRN_VERSION_MICRO)
file(READ ${MRN_SOURCE_DIR}/version_in_hex MRN_VERSION_IN_HEX)
file(READ ${MRN_SOURCE_DIR}/plugin_version MRN_PLUGIN_VERSION)
-if(MRN_GROONGA_BUNDLED)
- option(MRN_GROONGA_EMBED
- "Embed libgroonga"
- ON)
- if(MRN_GROONGA_EMBED)
- set(GRN_EMBED ON)
- endif()
-
- set(MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR
- "${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql")
- option(MRN_GROONGA_NORMALIZER_MYSQL_EMBED
- "Embed groonga-normalizer-mysql Groonga plugin"
- ON)
- if(EXISTS ${MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR})
- set(GROONGA_NORMALIZER_MYSQL_FOUND ON)
- else()
- set(GROONGA_NORMALIZER_MYSQL_FOUND OFF)
- set(MRN_GROONGA_NORMALIZER_MYSQL_EMBED OFF)
- endif()
- if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
- set(GROONGA_NORMALIZER_MYSQL_EMBED ON)
- endif()
-
- add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
-else()
- set(MRN_GROONGA_EMBED OFF)
-
- file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION)
- string(STRIP "${REQUIRED_GROONGA_VERSION}" REQUIRED_GROONGA_VERSION)
-
- file(READ
- ${MRN_SOURCE_DIR}/required_groonga_normalizer_mysql_version
- REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION)
- string(STRIP
- "${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}"
- REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION)
-endif()
-
set(MRN_PACKAGE_STRING "${PROJECT_NAME} ${MRN_VERSION}")
include(CheckCCompilerFlag)
@@ -151,7 +107,18 @@ read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/udf/sources.am MRN_UDF_SOURCES)
string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}udf/\\1"
MRN_UDF_SOURCES "${MRN_UDF_SOURCES}")
+set(MRN_ALL_SOURCES
+ ${MRN_SOURCES}
+ ${MRN_UDF_SOURCES}
+ ${LIBMRN_NO_MYSQL_SOURCES}
+ ${LIBMRN_NEED_MYSQL_SOURCES})
+
if(MRN_BUNDLED)
+ mysql_add_plugin(mroonga ${MRN_ALL_SOURCES} STORAGE_ENGINE MODULE_ONLY)
+ if(NOT TARGET mroonga)
+ return()
+ endif()
+
set(MYSQL_SOURCE_DIR ${CMAKE_SOURCE_DIR})
set(MYSQL_BUILD_DIR ${MYSQL_SOURCE_DIR})
set(MYSQL_CONFIG ${CMAKE_SOURCE_DIR}/scripts/mysql_config)
@@ -167,6 +134,44 @@ else()
endif()
find_path(MYSQL_CONFIG "${MYSQL_CONFIG}")
+if(MRN_GROONGA_BUNDLED)
+ option(MRN_GROONGA_EMBED
+ "Embed libgroonga"
+ ON)
+ if(MRN_GROONGA_EMBED)
+ set(GRN_EMBED ON)
+ endif()
+
+ set(MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR
+ "${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql")
+ option(MRN_GROONGA_NORMALIZER_MYSQL_EMBED
+ "Embed groonga-normalizer-mysql Groonga plugin"
+ ON)
+ if(EXISTS ${MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR})
+ set(GROONGA_NORMALIZER_MYSQL_FOUND ON)
+ else()
+ set(GROONGA_NORMALIZER_MYSQL_FOUND OFF)
+ set(MRN_GROONGA_NORMALIZER_MYSQL_EMBED OFF)
+ endif()
+ if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
+ set(GROONGA_NORMALIZER_MYSQL_EMBED ON)
+ endif()
+
+ add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
+else()
+ set(MRN_GROONGA_EMBED OFF)
+
+ file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION)
+ string(STRIP "${REQUIRED_GROONGA_VERSION}" REQUIRED_GROONGA_VERSION)
+
+ file(READ
+ ${MRN_SOURCE_DIR}/required_groonga_normalizer_mysql_version
+ REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION)
+ string(STRIP
+ "${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}"
+ REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION)
+endif()
+
if(EXISTS "${MYSQL_SOURCE_DIR}/storage/maria")
set(MYSQL_VARIANT "MariaDB")
else()
@@ -286,17 +291,8 @@ link_directories(
${MRN_LIBRARY_DIRS}
${MYSQL_LIBRARY_DIRS})
-set(MRN_ALL_SOURCES
- ${MRN_SOURCES}
- ${MRN_UDF_SOURCES}
- ${LIBMRN_NO_MYSQL_SOURCES}
- ${LIBMRN_NEED_MYSQL_SOURCES})
-
if(MRN_BUNDLED)
- mysql_add_plugin(mroonga
- ${MRN_ALL_SOURCES}
- STORAGE_ENGINE MODULE_ONLY
- LINK_LIBRARIES ${MRN_LIBRARIES})
+ target_link_libraries(mroonga ${MRN_LIBRARIES})
else()
add_library(mroonga MODULE ${MRN_ALL_SOURCES})