Commit c063892d authored by Leif Walsh's avatar Leif Walsh

#6 rename cmake functions duplicated in mysql to prevent name clash

parent ed5ce2d1
# Merge static libraries into a big static lib. The resulting library # Merge static libraries into a big static lib. The resulting library
# should not not have dependencies on other static libraries. # should not not have dependencies on other static libraries.
# We use it in MySQL to merge mysys,dbug,vio etc into mysqlclient # We use it in MySQL to merge mysys,dbug,vio etc into mysqlclient
FUNCTION(GET_DEPENDEND_OS_LIBS target result) FUNCTION(TOKU_GET_DEPENDEND_OS_LIBS target result)
SET(deps ${${target}_LIB_DEPENDS}) SET(deps ${${target}_LIB_DEPENDS})
IF(deps) IF(deps)
FOREACH(lib ${deps}) FOREACH(lib ${deps})
...@@ -15,9 +15,9 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result) ...@@ -15,9 +15,9 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result)
ENDFOREACH() ENDFOREACH()
ENDIF() ENDIF()
SET(${result} ${ret} PARENT_SCOPE) SET(${result} ${ret} PARENT_SCOPE)
ENDFUNCTION(GET_DEPENDEND_OS_LIBS) ENDFUNCTION(TOKU_GET_DEPENDEND_OS_LIBS)
MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) MACRO(TOKU_MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
# To produce a library we need at least one source file. # To produce a library we need at least one source file.
# It is created by ADD_CUSTOM_COMMAND below and will helps # It is created by ADD_CUSTOM_COMMAND below and will helps
# also help to track dependencies. # also help to track dependencies.
...@@ -40,7 +40,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) ...@@ -40,7 +40,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
SET(STATIC_LIBS ${STATIC_LIBS} ${LIB_LOCATION}) SET(STATIC_LIBS ${STATIC_LIBS} ${LIB_LOCATION})
ADD_DEPENDENCIES(${TARGET} ${LIB}) ADD_DEPENDENCIES(${TARGET} ${LIB})
# Extract dependend OS libraries # Extract dependend OS libraries
GET_DEPENDEND_OS_LIBS(${LIB} LIB_OSLIBS) TOKU_GET_DEPENDEND_OS_LIBS(${LIB} LIB_OSLIBS)
LIST(APPEND OSLIBS ${LIB_OSLIBS}) LIST(APPEND OSLIBS ${LIB_OSLIBS})
ELSE() ELSE()
# This is a shared library our static lib depends on. # This is a shared library our static lib depends on.
...@@ -97,4 +97,4 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) ...@@ -97,4 +97,4 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
) )
ENDIF() ENDIF()
ENDIF() ENDIF()
ENDMACRO(MERGE_STATIC_LIBS) ENDMACRO(TOKU_MERGE_STATIC_LIBS)
...@@ -21,7 +21,7 @@ add_library(tokuportability_static_conv STATIC ${tokuportability_srcs}) ...@@ -21,7 +21,7 @@ add_library(tokuportability_static_conv STATIC ${tokuportability_srcs})
set_target_properties(tokuportability_static_conv PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(tokuportability_static_conv PROPERTIES POSITION_INDEPENDENT_CODE ON)
add_dependencies(tokuportability_static_conv build_jemalloc) add_dependencies(tokuportability_static_conv build_jemalloc)
set(tokuportability_source_libs tokuportability_static_conv jemalloc ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS}) set(tokuportability_source_libs tokuportability_static_conv jemalloc ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
merge_static_libs(${LIBTOKUPORTABILITY}_static ${LIBTOKUPORTABILITY}_static "${tokuportability_source_libs}") toku_merge_static_libs(${LIBTOKUPORTABILITY}_static ${LIBTOKUPORTABILITY}_static "${tokuportability_source_libs}")
maybe_add_gcov_to_libraries(${LIBTOKUPORTABILITY} tokuportability_static_conv) maybe_add_gcov_to_libraries(${LIBTOKUPORTABILITY} tokuportability_static_conv)
set_property(TARGET ${LIBTOKUPORTABILITY} tokuportability_static_conv APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE) set_property(TARGET ${LIBTOKUPORTABILITY} tokuportability_static_conv APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
......
...@@ -26,7 +26,7 @@ add_library(tokudb_static_conv STATIC ${tokudb_srcs}) ...@@ -26,7 +26,7 @@ add_library(tokudb_static_conv STATIC ${tokudb_srcs})
add_dependencies(tokudb_static_conv install_tdb_h generate_log_code) add_dependencies(tokudb_static_conv install_tdb_h generate_log_code)
set_target_properties(tokudb_static_conv PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(tokudb_static_conv PROPERTIES POSITION_INDEPENDENT_CODE ON)
set(tokudb_source_libs tokudb_static_conv locktree_static ft_static util_static lzma) set(tokudb_source_libs tokudb_static_conv locktree_static ft_static util_static lzma)
merge_static_libs(${LIBTOKUDB}_static ${LIBTOKUDB}_static "${tokudb_source_libs}") toku_merge_static_libs(${LIBTOKUDB}_static ${LIBTOKUDB}_static "${tokudb_source_libs}")
## add gcov and define _GNU_SOURCE ## add gcov and define _GNU_SOURCE
maybe_add_gcov_to_libraries(${LIBTOKUDB} tokudb_static_conv) maybe_add_gcov_to_libraries(${LIBTOKUDB} tokudb_static_conv)
......
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