diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-11-18 22:26:20 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-11-18 22:26:20 +0100 |
commit | bb1ce607e37ed08004a1212367f87ce8ad306623 (patch) | |
tree | 7d52fa74c2f086ac9b9b0d85dbae78129d40da0a /storage/mroonga | |
parent | c417da24a36895f454e5abc645836fdf54964c83 (diff) | |
download | mariadb-git-bb1ce607e37ed08004a1212367f87ce8ad306623.tar.gz |
mroonga/groonga: CMakeLists.txt
* use the same HAVE_C/CXX_ variables for compiler flag tests as the rest of
the server and tokudb - to use cached results
* plugin's name should be "mroonga" not "ha_mroonga"
* don't use set_property(TARGET plugin_name ...), it aborts cmake when a plugin
id disabled, because the target doesn't exists in that case
result: mroonga can now be disabled from cmake command line
Diffstat (limited to 'storage/mroonga')
-rw-r--r-- | storage/mroonga/CMakeLists.txt | 53 | ||||
-rw-r--r-- | storage/mroonga/vendor/groonga/CMakeLists.txt | 14 |
2 files changed, 22 insertions, 45 deletions
diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt index fe467cba48f..c68f61a40b5 100644 --- a/storage/mroonga/CMakeLists.txt +++ b/storage/mroonga/CMakeLists.txt @@ -41,7 +41,7 @@ else() endif() if(MRN_BUNDLED) - if(WITHOUT_HA_MROONGA OR WITHOUT_HA_MROONGA_STORAGE_ENGINE) + if(WITHOUT_MROONGA OR WITHOUT_MROONGA_STORAGE_ENGINE) return() endif() endif() @@ -98,21 +98,15 @@ set(MRN_C_COMPILE_FLAGS "") set(MRN_CXX_COMPILE_FLAGS "") macro(mrn_check_cflag flag) - string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag}) - string(TOUPPER "${temporary_variable_name}" temporary_variable_name) - set(temporary_variable_name "CFLAG${temporary_variable_name}") - check_c_compiler_flag(${flag} ${temporary_variable_name}) - if(${temporary_variable_name}) + check_c_compiler_flag(${flag} "HAVE_C_${flag}") + if(HAVE_C_${flag}) set(MRN_C_COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS} ${flag}") endif() endmacro() macro(mrn_check_cxxflag flag) - string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag}) - string(TOUPPER "${temporary_variable_name}" temporary_variable_name) - set(temporary_variable_name "CXXFLAG${temporary_variable_name}") - check_cxx_compiler_flag(${flag} ${temporary_variable_name}) - if(${temporary_variable_name}) + check_cxx_compiler_flag(${flag} "HAVE_CXX_${flag}") + if(HAVE_CXX_${flag}) set(MRN_CXX_COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS} ${flag}") endif() endmacro() @@ -246,27 +240,19 @@ link_directories( if(MRN_BUNDLED) if(GROONGA_NORMALIZER_MYSQL_FOUND AND MRN_GROONGA_BUNDLED) - mysql_add_plugin(ha_mroonga + mysql_add_plugin(mroonga "${MROONGA_SOURCES};${MRN_UDF_SOURCES};${MRN_GRN_NORMALIZER_MYSQL_SOURCES};${LIBMRN_NEED_MYSQL_SOURCES};${LIBMRN_NO_MYSQL_SOURCES}" STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES ${GROONGA_LIBRARIES} MODULE_OUTPUT_NAME "ha_mroonga") else() - mysql_add_plugin(ha_mroonga + mysql_add_plugin(mroonga "${MROONGA_SOURCES};${MRN_UDF_SOURCES};${LIBMRN_NEED_MYSQL_SOURCES};${LIBMRN_NO_MYSQL_SOURCES}" STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES ${GROONGA_LIBRARIES} MODULE_OUTPUT_NAME "ha_mroonga") endif() - set(EXPANDED_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBDIR}") - list(FIND - CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - "${EXPANDED_INSTALL_LIBDIR}" - EXPANDED_INSTALL_LIBDIR_INDEX_IN_IMPLICIT_LINK_DIRECTORIES) - if(EXPANDED_INSTALL_LIBDIR_INDEX_IN_IMPLICIT_LINK_DIRECTORIES EQUAL -1) - set_property(TARGET ha_mroonga APPEND PROPERTY - INSTALL_RPATH "${EXPANDED_INSTALL_LIBDIR}") - endif() + else() else() add_library(ha_mroonga MODULE ${MROONGA_SOURCES} @@ -279,32 +265,32 @@ else() option(WITH_DEBUG "Enable debug options" OFF) if(WITH_DEBUG) - set_property(TARGET ha_mroonga APPEND PROPERTY + set_property(TARGET mroonga APPEND PROPERTY COMPILE_DEFINITIONS "SAFE_MUTEX") if(CMAKE_COMPILER_IS_GNUCXX) set(MRN_C_COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS} -g3 -O0") set(MRN_CXX_COMPILE_FLAGS "${MRN_CXX_COMPILE_FLAGS} -g3 -O0") endif() else() - set_property(TARGET ha_mroonga APPEND PROPERTY + set_property(TARGET mroonga APPEND PROPERTY COMPILE_DEFINITIONS "DBUG_OFF") endif() option(WITH_DEBUG_FULL "Enable full debug options" OFF) if(WITH_DEBUG_FULL) - set_property(TARGET ha_mroonga APPEND PROPERTY + set_property(TARGET mroonga APPEND PROPERTY COMPILE_DEFINITIONS "SAFE_MUTEX" "SAFEMALLOC") endif() option(DISABLE_FAST_MUTEXES "Force disabling fast mutex" OFF) if(DISABLE_FAST_MUTEXES) - set_property(TARGET ha_mroonga APPEND PROPERTY + set_property(TARGET mroonga APPEND PROPERTY COMPILE_DEFINITIONS "FORCE_FAST_MUTEX_DISABLED=1") endif() option(WITH_FAST_MUTEXES "Enable fast mutex" OFF) if(WITH_FAST_MUTEXES) - set_property(TARGET ha_mroonga APPEND PROPERTY + set_property(TARGET mroonga APPEND PROPERTY COMPILE_DEFINITIONS "MY_PTHREAD_FASTMUTEX") endif() @@ -327,7 +313,7 @@ else() COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS}") set_source_files_properties(${LIBMRN_NO_MYSQL_SOURCES} PROPERTIES COMPILE_FLAGS "${MRN_C_COMPILE_FLAGS}") - set_property(TARGET ha_mroonga APPEND PROPERTY + set_property(TARGET mroonga APPEND PROPERTY COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") set_target_properties(ha_mroonga PROPERTIES PREFIX "" @@ -338,21 +324,18 @@ endif() if(GROONGA_NORMALIZER_MYSQL_FOUND) set(WITH_GROONGA_NORMALIZER_MYSQL 1) - set_property(TARGET ha_mroonga APPEND PROPERTY - COMPILE_DEFINITIONS "WITH_GROONGA_NORMALIZER_MYSQL=1") + ADD_DEFINITIONS(-DWITH_GROONGA_NORMALIZER_MYSQL=1) if(MRN_GROONGA_BUNDLED) - set_property(TARGET ha_mroonga APPEND PROPERTY - COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC=1") + ADD_DEFINITIONS(-DGROONGA_NORMALIZER_MYSQL_PLUGIN_IS_BUNDLED_STATIC=1) else() set(GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME \"normalizers/mysql\") - set_property(TARGET ha_mroonga APPEND PROPERTY + set_property(TARGET mroonga APPEND PROPERTY COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=\"normalizers/mysql\"") endif() endif() set(MRN_DEFAULT_PARSER "TokenBigram" CACHE STRING "The default fulltext parser") -set_property(TARGET ha_mroonga APPEND PROPERTY - COMPILE_DEFINITIONS "MRN_PARSER_DEFAULT=\"${MRN_DEFAULT_PARSER}\"") +ADD_DEFINITIONS(-DMRN_PARSER_DEFAULT="${MRN_DEFAULT_PARSER}") configure_file( "${PROJECT_SOURCE_DIR}/mrn_version.h.in" diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt index 930556e8fe6..4f579d3c8a3 100644 --- a/storage/mroonga/vendor/groonga/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/CMakeLists.txt @@ -97,21 +97,15 @@ set(GRN_RUBY_SCRIPTS_DIR "${CMAKE_INSTALL_PREFIX}/${GRN_RELATIVE_RUBY_SCRIPTS_DIR}") macro(check_cflag flag) - string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag}) - string(TOUPPER "${temporary_variable_name}" temporary_variable_name) - set(temporary_variable_name "CFLAG${temporary_variable_name}") - check_c_compiler_flag(${flag} ${temporary_variable_name}) - if(${temporary_variable_name}) + check_c_compiler_flag(${flag} "HAVE_C_${flag}") + if(HAVE_C_${flag}) set(GRN_C_COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS} ${flag}") endif() endmacro() macro(check_cxxflag flag) - string(REGEX REPLACE "[-=]" "_" temporary_variable_name ${flag}) - string(TOUPPER "${temporary_variable_name}" temporary_variable_name) - set(temporary_variable_name "CXXFLAG${temporary_variable_name}") - check_cxx_compiler_flag(${flag} ${temporary_variable_name}) - if(${temporary_variable_name}) + check_cxx_compiler_flag(${flag} "HAVE_CXX_${flag}") + if(HAVE_CXX_${flag}) set(GRN_CXX_COMPILE_FLAGS "${GRN_CXX_COMPILE_FLAGS} ${flag}") endif() endmacro() |