summaryrefslogtreecommitdiff
path: root/cmake/libutils.cmake
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-12-01 12:00:50 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-12-01 12:00:50 +0100
commitd2139f313583aa7f6e09a505ea44aff0073d0d0d (patch)
treed89705a5ecb9443a34d6ac498e2557565ff952b2 /cmake/libutils.cmake
parent43770e8f3f3fd22259b330756fad72737b079263 (diff)
downloadmariadb-git-d2139f313583aa7f6e09a505ea44aff0073d0d0d.tar.gz
- Introduce MYSQL_ADD_PLUGIN that replaces MYSQL_STORAGE_ENGINE
- Fix semisync library prefix (remove lib on Unixes) - restrict exported symbols from zlib and yassl (fvisibility=hidden)
Diffstat (limited to 'cmake/libutils.cmake')
-rw-r--r--cmake/libutils.cmake45
1 files changed, 10 insertions, 35 deletions
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
index ea8f809de9f..be0523d7080 100644
--- a/cmake/libutils.cmake
+++ b/cmake/libutils.cmake
@@ -53,11 +53,11 @@
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
-IF(NOT WIN32 AND NOT CYGWIN AND NOT APPLE AND NOT WITH_PIC AND NOT DISABLE_SHARED
- AND CMAKE_SHARED_LIBRARY_C_FLAGS)
+IF(WIN32 OR CYGWIN OR APPLE OR WITH_PIC OR DISABLE_SHARED OR NOT CMAKE_SHARED_LIBRARY_C_FLAGS)
SET(_SKIP_PIC 1)
ENDIF()
-
+
+INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# CREATE_EXPORT_FILE (VAR target api_functions)
# Internal macro, used to create source file for shared libraries that
# otherwise consists entirely of "convenience" libraries. On Windows,
@@ -108,38 +108,6 @@ MACRO(ADD_CONVENIENCE_LIBRARY)
ENDMACRO()
-# Handy macro to parse macro arguments
-MACRO(CMAKE_PARSE_ARGUMENTS prefix arg_names option_names)
- SET(DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
-
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- SET(larg_names ${arg_names})
- LIST(FIND larg_names "${arg}" is_arg_name)
- IF (is_arg_name GREATER -1)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name GREATER -1)
- SET(loption_names ${option_names})
- LIST(FIND loption_names "${arg}" is_option)
- IF (is_option GREATER -1)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option GREATER -1)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option GREATER -1)
- ENDIF (is_arg_name GREATER -1)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO()
-
# Write content to file, using CONFIGURE_FILE
# The advantage compared to FILE(WRITE) is that timestamp
# does not change if file already has the same content
@@ -289,3 +257,10 @@ MACRO(MERGE_LIBRARIES)
ENDIF()
ENDMACRO()
+MACRO(RESTRICT_SYMBOL_EXPORTS target)
+ IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
+ GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS)
+ SET_TARGET_PROPERTIES(${target} PROPERTIES
+ COMPILE_FLAGS "${COMPILE_FLAGS} -fvisibility=hidden")
+ ENDIF()
+ENDMACRO()