Commit 49d6568a authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Reduce size of windows MSI by approx. 50%

- Mark test components, plugins etc with COMPONENT Test, to get them excluded from the MSI
- Only include debug symbols for client and embedded libs and also
  mysqld.exe and server plugins (so we can still can get a callstack in case of crash)

The rest (all *.pdbs, test components, MTR) can be obtained from the big ZIP distribution, if required.
parent c5e1fb67
...@@ -15,37 +15,46 @@ ...@@ -15,37 +15,46 @@
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
MACRO (INSTALL_DEBUG_SYMBOLS targets)
FUNCTION (INSTALL_DEBUG_SYMBOLS)
IF(MSVC) IF(MSVC)
FOREACH(target ${targets}) MYSQL_PARSE_ARGUMENTS(ARG
GET_TARGET_PROPERTY(location ${target} LOCATION) "COMPONENT;INSTALL_LOCATION"
GET_TARGET_PROPERTY(type ${target} TYPE) ""
IF(NOT INSTALL_LOCATION) ${ARGN}
IF(type MATCHES "STATIC_LIBRARY" OR type MATCHES "MODULE_LIBRARY" OR type MATCHES "SHARED_LIBRARY") )
SET(INSTALL_LOCATION "lib")
ELSEIF(type MATCHES "EXECUTABLE") IF(NOT ARG_COMPONENT)
SET(INSTALL_LOCATION "bin") MESSAGE(FATAL_ERROR "No COMPONENT passed to INSTALL_DEBUG_SYMBOLS")
ELSE()
MESSAGE(FATAL_ERROR "cannot determine type of ${target}. Don't now where to install")
ENDIF() ENDIF()
IF(NOT ARG_INSTALL_LOCATION)
MESSAGE(FATAL_ERROR "No INSTALL_LOCATION passed to INSTALL_DEBUG_SYMBOLS")
ENDIF() ENDIF()
SET(targets ${ARG_DEFAULT_ARGS})
FOREACH(target ${targets})
GET_TARGET_PROPERTY(type ${target} TYPE)
GET_TARGET_PROPERTY(location ${target} LOCATION)
STRING(REPLACE ".exe" ".pdb" pdb_location ${location}) STRING(REPLACE ".exe" ".pdb" pdb_location ${location})
STRING(REPLACE ".dll" ".pdb" pdb_location ${pdb_location}) STRING(REPLACE ".dll" ".pdb" pdb_location ${pdb_location})
STRING(REPLACE ".lib" ".pdb" pdb_location ${pdb_location}) STRING(REPLACE ".lib" ".pdb" pdb_location ${pdb_location})
IF(CMAKE_GENERATOR MATCHES "Visual Studio") IF(CMAKE_GENERATOR MATCHES "Visual Studio")
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location}) STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location})
ENDIF() ENDIF()
IF(target STREQUAL "mysqld") IF(ARG_COMPONENT STREQUAL "Server" AND (target MATCHES "mysqld" OR type MATCHES "MODULE"))
#MESSAGE("PDB: ${targets}")
SET(comp Server) SET(comp Server)
ELSEIF(pdb_location MATCHES "mysql-test") ELSEIF(ARG_COMPONENT MATCHES Development
SET(comp Tests) OR ARG_COMPONENT MATCHES SharedLibraries
ELSE() OR ARG_COMPONENT MATCHES Embedded)
SET(comp Debuginfo) SET(comp Debuginfo)
ELSE()
SET(comp Debuginfo_archive_only) # not in MSI
ENDIF() ENDIF()
INSTALL(FILES ${pdb_location} DESTINATION ${INSTALL_LOCATION} COMPONENT ${comp}) INSTALL(FILES ${pdb_location} DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp})
ENDFOREACH() ENDFOREACH()
ENDIF() ENDIF()
ENDMACRO() ENDFUNCTION()
# Installs manpage for given file (either script or executable) # Installs manpage for given file (either script or executable)
# #
...@@ -207,6 +216,8 @@ FUNCTION(MYSQL_INSTALL_TARGETS) ...@@ -207,6 +216,8 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
) )
IF(ARG_COMPONENT) IF(ARG_COMPONENT)
SET(COMP COMPONENT ${ARG_COMPONENT}) SET(COMP COMPONENT ${ARG_COMPONENT})
ELSE()
MESSAGE(FATAL_ERROR "COMPONENT argument required")
ENDIF() ENDIF()
SET(TARGETS ${ARG_DEFAULT_ARGS}) SET(TARGETS ${ARG_DEFAULT_ARGS})
...@@ -231,9 +242,8 @@ FUNCTION(MYSQL_INSTALL_TARGETS) ...@@ -231,9 +242,8 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
ENDFOREACH() ENDFOREACH()
INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP})
SET(INSTALL_LOCATION ${ARG_DESTINATION} ) INSTALL_DEBUG_SYMBOLS(${TARGETS} ${COMP} INSTALL_LOCATION ${ARG_DESTINATION})
INSTALL_DEBUG_SYMBOLS("${TARGETS}")
SET(INSTALL_LOCATION)
ENDFUNCTION() ENDFUNCTION()
# Optionally install mysqld/client/embedded from debug build run. outside of the current build dir # Optionally install mysqld/client/embedded from debug build run. outside of the current build dir
......
...@@ -45,7 +45,7 @@ ENDMACRO() ...@@ -45,7 +45,7 @@ ENDMACRO()
MACRO(MYSQL_ADD_PLUGIN) MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME" "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED" "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
${ARGN} ${ARGN}
) )
...@@ -207,8 +207,11 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -207,8 +207,11 @@ MACRO(MYSQL_ADD_PLUGIN)
SET_TARGET_PROPERTIES(${target} PROPERTIES SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}") OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library # Install dynamic library
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server) IF(NOT ARG_COMPONENT)
INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug) SET(ARG_COMPONENT Server)
ENDIF()
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT ${ARG_COMPONENT})
INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug COMPONENT ${ARG_COMPONENT})
# Add installed files to list for RPMs # Add installed files to list for RPMs
FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files
"%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n" "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n"
......
...@@ -25,13 +25,15 @@ ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT) ...@@ -25,13 +25,15 @@ ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT)
MYSQL_ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc MYSQL_ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc) ../../client/mysql.cc ../../client/readline.cc
COMPONENT Test)
TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver) TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver)
IF(UNIX) IF(UNIX)
TARGET_LINK_LIBRARIES(mysql_embedded ${MY_READLINE_LIBRARY}) TARGET_LINK_LIBRARIES(mysql_embedded ${MY_READLINE_LIBRARY})
ENDIF(UNIX) ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc) MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc
COMPONENT Test)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver) TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver)
IF(CMAKE_GENERATOR MATCHES "Xcode") IF(CMAKE_GENERATOR MATCHES "Xcode")
...@@ -47,7 +49,8 @@ IF(CMAKE_GENERATOR MATCHES "Xcode") ...@@ -47,7 +49,8 @@ IF(CMAKE_GENERATOR MATCHES "Xcode")
${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc ${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc
../../tests/mysql_client_test.c) ../../tests/mysql_client_test.c)
ELSE() ELSE()
MYSQL_ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c) MYSQL_ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c
COMPONENT Test)
SET_TARGET_PROPERTIES(mysql_client_test_embedded PROPERTIES HAS_CXX TRUE) SET_TARGET_PROPERTIES(mysql_client_test_embedded PROPERTIES HAS_CXX TRUE)
ENDIF() ENDIF()
TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver) TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver)
......
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_ADD_PLUGIN(audit_null audit_null.c MYSQL_ADD_PLUGIN(audit_null audit_null.c
MODULE_ONLY MODULE_OUTPUT_NAME "adt_null") MODULE_ONLY MODULE_OUTPUT_NAME "adt_null" COMPONENT Test)
...@@ -15,17 +15,17 @@ ...@@ -15,17 +15,17 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_ADD_PLUGIN(dialog_examples dialog_examples.c MYSQL_ADD_PLUGIN(dialog_examples dialog_examples.c
MODULE_ONLY) MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(auth_test_plugin test_plugin.c MYSQL_ADD_PLUGIN(auth_test_plugin test_plugin.c
MODULE_ONLY) MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(qa_auth_interface qa_auth_interface.c MYSQL_ADD_PLUGIN(qa_auth_interface qa_auth_interface.c
MODULE_ONLY) MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(qa_auth_server qa_auth_server.c MYSQL_ADD_PLUGIN(qa_auth_server qa_auth_server.c
MODULE_ONLY) MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c
MODULE_ONLY) MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(mysql_clear_password clear_password_client.c MYSQL_ADD_PLUGIN(mysql_clear_password clear_password_client.c
MODULE_ONLY) MODULE_ONLY COMPONENT SharedLibraries)
...@@ -14,6 +14,6 @@ ...@@ -14,6 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc
MODULE_ONLY MODULE_OUTPUT_NAME "libdaemon_example") MODULE_ONLY MODULE_OUTPUT_NAME "libdaemon_example" COMPONENT Test)
INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR}) INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Test)
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_ADD_PLUGIN(ftexample plugin_example.c MYSQL_ADD_PLUGIN(ftexample plugin_example.c
MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib") MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib" COMPONENT Test)
...@@ -29,6 +29,6 @@ IF(WIN32) ...@@ -29,6 +29,6 @@ IF(WIN32)
MYSQL_ADD_PLUGIN(authentication_windows_client ${PLUGIN_SOURCES} ${HEADERS} MYSQL_ADD_PLUGIN(authentication_windows_client ${PLUGIN_SOURCES} ${HEADERS}
LINK_LIBRARIES Secur32 LINK_LIBRARIES Secur32
MODULE_ONLY) MODULE_ONLY COMPONENT SharedLibraries)
ENDIF(WIN32) ENDIF(WIN32)
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(EXAMPLE_SOURCES ha_example.cc) SET(EXAMPLE_SOURCES ha_example.cc)
MYSQL_ADD_PLUGIN(example ${EXAMPLE_SOURCES} STORAGE_ENGINE MODULE_ONLY) MYSQL_ADD_PLUGIN(example ${EXAMPLE_SOURCES} STORAGE_ENGINE MODULE_ONLY COMPONENT Test)
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