mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
CMake cleanup - simplify create_initial_db.cmake
Also make initial_database optional target on non-Windows, as sometimes it can be quite handy to bootstrap without MTR.
This commit is contained in:
parent
574d8b2940
commit
9d7ed94f6a
2 changed files with 11 additions and 24 deletions
|
@ -37,8 +37,6 @@ ENDFOREACH()
|
|||
FILE(READ ${TOP_SRCDIR}/scripts/fill_help_tables.sql CONTENTS)
|
||||
FILE(APPEND bootstrap.sql "${CONTENTS}")
|
||||
|
||||
FILE(REMOVE_RECURSE mysql performance_schema)
|
||||
FILE(REMOVE ibdata1 ib_logfile0 ib_logfile1)
|
||||
|
||||
MAKE_DIRECTORY(mysql)
|
||||
|
||||
|
@ -46,13 +44,8 @@ SET(BOOTSTRAP_COMMAND
|
|||
${MYSQLD_EXECUTABLE}
|
||||
--no-defaults
|
||||
--console
|
||||
--bootstrap
|
||||
--lc-messages-dir=${BINDIR}/share
|
||||
--basedir=.
|
||||
--bootstrap
|
||||
--datadir=.
|
||||
--default-storage-engine=MyISAM
|
||||
--max_allowed_packet=8M
|
||||
--net_buffer_length=32K
|
||||
)
|
||||
|
||||
GET_FILENAME_COMPONENT(CWD . ABSOLUTE)
|
||||
|
|
|
@ -433,16 +433,9 @@ ADD_CUSTOM_TARGET(distclean
|
|||
VERBATIM
|
||||
)
|
||||
|
||||
IF(INSTALL_LAYOUT STREQUAL "STANDALONE")
|
||||
|
||||
# Copy db.opt into data/test/
|
||||
SET(DBOPT_FILE ${CMAKE_SOURCE_DIR}/support-files/db.opt )
|
||||
INSTALL(FILES ${DBOPT_FILE} DESTINATION data/test COMPONENT DataFiles)
|
||||
|
||||
# Install initial database on windows
|
||||
IF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
|
||||
|
||||
IF(MSVC_IDE OR CMAKE_GENERATOR MATCHES "Xcode")
|
||||
# Install initial database (default on windows, optional target elsewhere)
|
||||
IF(TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
|
||||
IF(GENERATOR_IS_MULTI_CONFIG)
|
||||
SET (CONFIG_PARAM -DCONFIG=${CMAKE_CFG_INTDIR})
|
||||
ENDIF()
|
||||
MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/data)
|
||||
|
@ -461,15 +454,16 @@ IF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
|
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/
|
||||
DEPENDS mysqld
|
||||
)
|
||||
IF(WIN32)
|
||||
SET(ALL_ON_WINDOWS ALL)
|
||||
ELSE()
|
||||
SET(ALL_ON_WINDOWS)
|
||||
ENDIF()
|
||||
ADD_CUSTOM_TARGET(initial_database
|
||||
ALL
|
||||
${ALL_ON_WINDOWS}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
|
||||
)
|
||||
ELSE()
|
||||
# Not windows or cross compiling, just install an empty directory
|
||||
INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
|
||||
ENDIF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
|
||||
ENDIF(INSTALL_LAYOUT STREQUAL "STANDALONE")
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
SET(my_bootstrap_sql ${CMAKE_CURRENT_BINARY_DIR}/my_bootstrap.sql)
|
||||
|
|
Loading…
Reference in a new issue