Commit b8eadebf authored by joerg@trift2's avatar joerg@trift2

Merge trift2.:/MySQL/M51/clone-5.1

into  trift2.:/MySQL/M51/push-5.1
parents 55d3781d c8dc63b3
...@@ -21,22 +21,6 @@ INCLUDE(win/configure.data) ...@@ -21,22 +21,6 @@ INCLUDE(win/configure.data)
# Hardcode support for CSV storage engine # Hardcode support for CSV storage engine
SET(WITH_CSV_STORAGE_ENGINE TRUE) SET(WITH_CSV_STORAGE_ENGINE TRUE)
# CMAKE will not allow custom VS7+ configurations. mysqld and libmysqld
# cannot be built at the same time as they require different configurations
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
# By default, CMake will create Release, Debug, RelWithDebInfo and MinSizeRel
# configurations. The EMBEDDED_ONLY build parameter is necessary because CMake
# doesn't support custom build configurations for VS2005. Since the Debug
# configuration does not work properly with USE_TLS defined
# (see mysys/CMakeLists.txt) the easiest way to debug the Embedded Server is to
# use the RelWithDebInfo configuration without optimizations.
#
# Debug default CXX_FLAGS "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1"
# RelWithDebInfo default CXX_FLAGS "/MD /Zi /O2 /Ob1 /D NDEBUG"
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /Od /Ob0 /D NDEBUG" CACHE STRING "No Optimization" FORCE)
ENDIF(EMBEDDED_ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY) ${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY)
...@@ -154,7 +138,9 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR ...@@ -154,7 +138,9 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
CMAKE_GENERATOR MATCHES "Visual Studio 8") CMAKE_GENERATOR MATCHES "Visual Studio 8")
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") IF(WIN32)
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
ENDIF(WIN32)
IF(EMBED_MANIFESTS) IF(EMBED_MANIFESTS)
# Search for the tools (mt, makecat, signtool) necessary for embedding # Search for the tools (mt, makecat, signtool) necessary for embedding
...@@ -229,7 +215,7 @@ ADD_SUBDIRECTORY(extra) ...@@ -229,7 +215,7 @@ ADD_SUBDIRECTORY(extra)
ADD_SUBDIRECTORY(storage/heap) ADD_SUBDIRECTORY(storage/heap)
ADD_SUBDIRECTORY(storage/myisam) ADD_SUBDIRECTORY(storage/myisam)
ADD_SUBDIRECTORY(storage/myisammrg) ADD_SUBDIRECTORY(storage/myisammrg)
ADD_SUBDIRECTORY(client)
IF(WITH_ARCHIVE_STORAGE_ENGINE) IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/archive) ADD_SUBDIRECTORY(storage/archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
...@@ -248,13 +234,11 @@ ENDIF(WITH_FEDERATED_STORAGE_ENGINE) ...@@ -248,13 +234,11 @@ ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/innobase) ADD_SUBDIRECTORY(storage/innobase)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE) ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(server-tools/instance-manager)
ADD_SUBDIRECTORY(libmysql) ADD_SUBDIRECTORY(libmysql)
IF(EMBEDDED_ONLY) ADD_SUBDIRECTORY(tests)
IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld) ADD_SUBDIRECTORY(libmysqld)
ADD_SUBDIRECTORY(libmysqld/examples) ADD_SUBDIRECTORY(libmysqld/examples)
ELSE(EMBEDDED_ONLY) ENDIF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(server-tools/instance-manager)
ADD_SUBDIRECTORY(tests)
ENDIF(EMBEDDED_ONLY)
...@@ -38,6 +38,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ...@@ -38,6 +38,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
# Include and add the directory path # Include and add the directory path
SET(SOURCE_SUBLIBS TRUE) SET(SOURCE_SUBLIBS TRUE)
SET(LIB_SOURCES "")
INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt) INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
FOREACH(rpath ${ZLIB_SOURCES}) FOREACH(rpath ${ZLIB_SOURCES})
...@@ -118,16 +119,16 @@ ADD_LIBRARY(mysqlclient_notls STATIC ${CLIENT_SOURCES}) ...@@ -118,16 +119,16 @@ ADD_LIBRARY(mysqlclient_notls STATIC ${CLIENT_SOURCES})
ADD_DEPENDENCIES(mysqlclient_notls GenError) ADD_DEPENDENCIES(mysqlclient_notls GenError)
TARGET_LINK_LIBRARIES(mysqlclient_notls) TARGET_LINK_LIBRARIES(mysqlclient_notls)
IF(NOT EMBEDDED_ONLY) ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} dll.c libmysql.def)
ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} dll.c libmysql.def) IF(WIN32)
SET_TARGET_PROPERTIES(libmysql mysqlclient PROPERTIES COMPILE_FLAGS "-DUSE_TLS") SET_TARGET_PROPERTIES(libmysql mysqlclient PROPERTIES COMPILE_FLAGS "-DUSE_TLS")
ADD_DEPENDENCIES(libmysql GenError) ENDIF(WIN32)
TARGET_LINK_LIBRARIES(libmysql wsock32) ADD_DEPENDENCIES(libmysql GenError)
TARGET_LINK_LIBRARIES(libmysql wsock32)
ADD_EXECUTABLE(myTest mytest.c) ADD_EXECUTABLE(myTest mytest.c)
TARGET_LINK_LIBRARIES(myTest libmysql) TARGET_LINK_LIBRARIES(myTest libmysql)
IF(EMBED_MANIFESTS) IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker") MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
ENDIF(NOT EMBEDDED_ONLY)
...@@ -18,7 +18,11 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ...@@ -18,7 +18,11 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Need to set USE_TLS, since __declspec(thread) approach to thread local # Need to set USE_TLS, since __declspec(thread) approach to thread local
# storage does not work properly in DLLs. # storage does not work properly in DLLs.
ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER) IF(WIN32)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(WIN32)
ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld ${CMAKE_SOURCE_DIR}/libmysqld
...@@ -26,18 +30,124 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ...@@ -26,18 +30,124 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include ${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/zlib)
)
SET_SOURCE_FILES_PROPERTIES(sql_yacc.cc SET(GEN_SOURCES ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
sql_yacc.h ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
message.h ${CMAKE_SOURCE_DIR}/sql/message.h
message.rc ${CMAKE_SOURCE_DIR}/sql/message.rc
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
lex_hash.h ${CMAKE_SOURCE_DIR}/sql/lex_hash.h)
PROPERTIES GENERATED 1)
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
# Include and add the directory path
SET(SOURCE_SUBLIBS TRUE)
SET(LIB_SOURCES "")
INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
FOREACH(rpath ${ZLIB_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../zlib/${rpath})
ENDFOREACH(rpath)
# FIXME only needed if build type is "Debug", but CMAKE_BUILD_TYPE is
# not set during configure time.
INCLUDE(${CMAKE_SOURCE_DIR}/dbug/CMakeLists.txt)
FOREACH(rpath ${DBUG_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../dbug/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/CMakeLists.txt)
FOREACH(rpath ${TAOCRYPT_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/taocrypt/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/CMakeLists.txt)
FOREACH(rpath ${YASSL_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/strings/CMakeLists.txt)
FOREACH(rpath ${STRINGS_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../strings/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/regex/CMakeLists.txt)
FOREACH(rpath ${REGEX_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../regex/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/mysys/CMakeLists.txt)
FOREACH(rpath ${MYSYS_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../mysys/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/vio/CMakeLists.txt)
FOREACH(rpath ${VIO_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../vio/${rpath})
ENDFOREACH(rpath)
# Engines
INCLUDE(${CMAKE_SOURCE_DIR}/storage/heap/CMakeLists.txt)
FOREACH(rpath ${HEAP_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/heap/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisam/CMakeLists.txt)
FOREACH(rpath ${MYISAM_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisam/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisammrg/CMakeLists.txt)
FOREACH(rpath ${MYISAMMRG_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisammrg/${rpath})
ENDFOREACH(rpath)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/archive/CMakeLists.txt)
FOREACH(rpath ${ARCHIVE_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/archive/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/blackhole/CMakeLists.txt)
FOREACH(rpath ${BLACKHOLE_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/blackhole/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/example/CMakeLists.txt)
FOREACH(rpath ${EXAMPLE_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/example/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/federated/CMakeLists.txt)
FOREACH(rpath ${FEDERATED_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/federated/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc IF(WITH_INNOBASE_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/innobase/CMakeLists.txt)
FOREACH(rpath ${INNOBASE_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/innobase/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/csv/CMakeLists.txt)
FOREACH(rpath ${CSV_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/csv/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_CSV_STORAGE_ENGINE)
SET(SOURCE_SUBLIBS FALSE)
SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c ../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
../sql-common/client.c ../sql-common/my_time.c ../sql-common/client.c ../sql-common/my_time.c
../sql-common/my_user.c ../sql-common/pack.c ../sql-common/my_user.c ../sql-common/pack.c
...@@ -69,101 +179,30 @@ ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc ...@@ -69,101 +179,30 @@ ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc ../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc
../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc ../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc
../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc ../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc
../sql/sql_select.cc ../sql/sql_servers.cc ../sql/sql_builtin.cc ../sql/sql_select.cc ../sql/sql_servers.cc
../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc ../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc
../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc
../sql/sql_update.cc ../sql/sql_view.cc ../sql/sql_update.cc ../sql/sql_view.cc
../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
../sql/partition_info.cc ../sql/sql_locale.cc ../sql/sql_connect.cc ../sql/partition_info.cc ../sql/sql_connect.cc
../sql/scheduler.cc ../sql/scheduler.cc
../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ${GEN_SOURCES}
../vio/viosslfactories.c ${LIB_SOURCES})
sql_yacc.cc
sql_yacc.h
message.h
message.rc
lex_hash.h)
ADD_DEPENDENCIES(mysqldemb GenError)
# Sql Parser custom command
ADD_CUSTOM_COMMAND(
SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
OUTPUT sql_yacc.cc
COMMAND bison.exe
ARGS -y -p MYSQL --defines=sql_yacc.h
--output=sql_yacc.cc ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
)
ADD_CUSTOM_COMMAND(
OUTPUT sql_yacc.h
COMMAND echo
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
)
# Windows message file
ADD_CUSTOM_COMMAND(
SOURCE ${CMAKE_SOURCE_DIR}/sql/message.mc
OUTPUT message.rc message.h
COMMAND mc
ARGS ${CMAKE_SOURCE_DIR}/sql/message.mc
DEPENDS ${CMAKE_SOURCE_DIR}/sql/message.mc
)
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash ../sql/gen_lex_hash.cc)
TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32)
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
ADD_CUSTOM_COMMAND(
OUTPUT lex_hash.h
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
DEPENDS ${GEN_LEX_HASH_EXE}
)
# Remove the auto-generated files as part of 'Clean Solution'
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"lex_hash.h;message.rc;message.h;sql_yacc.h;sql_yacc.cc")
ADD_DEPENDENCIES(mysqldemb gen_lex_hash)
# Seems we cannot make a library without at least one source file. So use a # Seems we cannot make a library without at least one source file. So use a
# dummy empty file # dummy empty file
FILE(WRITE cmake_dummy.c " ") FILE(WRITE cmake_dummy.c " ")
ADD_LIBRARY(mysqlserver cmake_dummy.c) # Tried use the correct ${GEN_SOURCES} as dependency, worked on Unix
TARGET_LINK_LIBRARIES(mysqlserver wsock32) # but not on Windows and Visual Studio generators. Likely because they
ADD_DEPENDENCIES(mysqlserver mysqldemb heap myisam myisammrg dbug mysys zlib strings mysqldemb regex # are no real targets from the Visual Studio project files view. Added
yassl taocrypt vio) # custom targets to "sql/CMakeLists.txt" and reference them here.
IF(WITH_ARCHIVE_STORAGE_ENGINE) ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES})
ADD_DEPENDENCIES(mysqlserver archive) ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) TARGET_LINK_LIBRARIES(mysqlserver)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver example)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqlserver blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqlserver csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver federated)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver innobase)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def) ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def)
TARGET_LINK_LIBRARIES(libmysqld wsock32)
ADD_DEPENDENCIES(libmysqld mysqlserver) ADD_DEPENDENCIES(libmysqld mysqlserver)
IF(WITH_ARCHIVE_STORAGE_ENGINE) TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32)
ADD_DEPENDENCIES(libmysqld archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(libmysqld blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(libmysqld csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
...@@ -15,24 +15,24 @@ ...@@ -15,24 +15,24 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include ${CMAKE_SOURCE_DIR}/libmysqld/include
${CMAKE_SOURCE_DIR}/libmysqld/release
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
# Currently does not work with DBUG, there are missing symbols reported. # Currently does not work with DBUG, there are missing symbols reported.
ADD_DEFINITIONS(-DDBUG_OFF) IF(WIN32)
ADD_DEFINITIONS(-DUSE_TLS) ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(WIN32)
ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc ../../client/mysql.cc ../../client/readline.cc
../../client/sql_string.cc) ../../client/sql_string.cc)
TARGET_LINK_LIBRARIES(mysql_embedded mysys yassl taocrypt zlib dbug regex strings wsock32) TARGET_LINK_LIBRARIES(mysql_embedded mysys yassl taocrypt zlib debug dbug regex strings wsock32)
ADD_DEPENDENCIES(mysql_embedded libmysqld) ADD_DEPENDENCIES(mysql_embedded libmysqld)
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c) ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib dbug regex strings wsock32) TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib debug dbug regex strings wsock32)
ADD_DEPENDENCIES(mysqltest_embedded libmysqld) ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c) ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
TARGET_LINK_LIBRARIES(mysql_client_test_embedded dbug mysys yassl taocrypt zlib strings wsock32) TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug mysys yassl taocrypt zlib strings wsock32)
ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld) ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld)
...@@ -23,14 +23,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ...@@ -23,14 +23,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Exception is the embedded server that needs this library compiled with # Exception is the embedded server that needs this library compiled with
# dynamic TLS, i.e. define USE_TLS # dynamic TLS, i.e. define USE_TLS
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys)
ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_modify.c SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_modify.c
errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c
mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c
mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c
...@@ -47,3 +42,7 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m ...@@ -47,3 +42,7 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m
my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c
rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c
thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c) thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(mysys ${MYSYS_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -17,4 +17,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE ...@@ -17,4 +17,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(regex debug.c regcomp.c regerror.c regexec.c regfree.c reginit.c split.c)
SET(REGEX_SOURCES debug.c regcomp.c regerror.c regexec.c regfree.c reginit.c split.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(regex ${REGEX_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -24,7 +24,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql ...@@ -24,7 +24,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql
ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instance.cc instance_map.cc ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instance.cc instance_map.cc
instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc
mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc
thread_registry.cc user_map.cc imservice.cpp windowsservice.cpp thread_registry.cc user_map.cc IMService.cpp WindowsService.cpp
user_management_commands.cc user_management_commands.cc
../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c ../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c
......
...@@ -41,7 +41,7 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc ...@@ -41,7 +41,7 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN) ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN)
ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX} ADD_EXECUTABLE(mysqld
../sql-common/client.c derror.cc des_key_file.cc ../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc filesort.cc gstream.cc
...@@ -83,65 +83,82 @@ ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX} ...@@ -83,65 +83,82 @@ ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX}
${PROJECT_SOURCE_DIR}/include/mysql_version.h ${PROJECT_SOURCE_DIR}/include/mysql_version.h
${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc ${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc
${PROJECT_SOURCE_DIR}/sql/lex_hash.h) ${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX}
TARGET_LINK_LIBRARIES(mysqld
heap myisam myisammrg mysys yassl zlib debug dbug yassl heap myisam myisammrg mysys yassl zlib debug dbug yassl
taocrypt strings vio regex wsock32 ws2_32) taocrypt strings vio regex wsock32 ws2_32)
SET_TARGET_PROPERTIES(mysqld PROPERTIES OUTPUT_NAME mysqld${MYSQLD_EXE_SUFFIX})
# Work around for 2.4.6 bug, OUTPUT_NAME will not set the right .PDB
# file name. Note that COMPILE_FLAGS set some temporary pdb during build,
# LINK_FLAGS sets the real one.
SET_TARGET_PROPERTIES(mysqld PROPERTIES
COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/mysqld${MYSQLD_EXE_SUFFIX}.pdb"
LINK_FLAGS "/PDB:${CMAKE_CFG_INTDIR}/mysqld${MYSQLD_EXE_SUFFIX}.pdb")
IF(EMBED_MANIFESTS) IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("mysqld" "asInvoker") MYSQL_EMBED_MANIFEST("mysqld" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
IF(WITH_ARCHIVE_STORAGE_ENGINE) IF(WITH_ARCHIVE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} archive) TARGET_LINK_LIBRARIES(mysqld archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE) IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} blackhole) TARGET_LINK_LIBRARIES(mysqld blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE) ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE) IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} csv) TARGET_LINK_LIBRARIES(mysqld csv)
ENDIF(WITH_CSV_STORAGE_ENGINE) ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE) IF(WITH_EXAMPLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} example) TARGET_LINK_LIBRARIES(mysqld example)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE) IF(WITH_FEDERATED_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} federated) TARGET_LINK_LIBRARIES(mysqld federated)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE) ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} innobase) TARGET_LINK_LIBRARIES(mysqld innobase)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE) ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} GenError) ADD_DEPENDENCIES(mysqld GenError)
# NOTE CMake 2.4.6 creates strange dependencies between files in OUTPUT,
# so for now we only list one if more than one
# Sql Parser custom command # Sql Parser custom command
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc # ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h
--output=sql_yacc.cc sql_yacc.yy --output=sql_yacc.cc sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy) DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
ADD_CUSTOM_COMMAND( IF(WIN32)
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h # Windows message file
COMMAND echo ADD_CUSTOM_COMMAND(
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc OUTPUT ${PROJECT_SOURCE_DIR}/sql/message.h
) # ${PROJECT_SOURCE_DIR}/sql/message.rc
# Windows message file
ADD_CUSTOM_COMMAND(
SOURCE message.mc
OUTPUT message.rc message.h
COMMAND mc ARGS message.mc COMMAND mc ARGS message.mc
DEPENDS message.mc) DEPENDS ${PROJECT_SOURCE_DIR}/sql/message.mc)
ENDIF(WIN32)
# Gen_lex_hash # Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc) ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32) TARGET_LINK_LIBRARIES(gen_lex_hash debug dbug mysqlclient wsock32)
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION) GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
DEPENDS ${GEN_LEX_HASH_EXE} DEPENDS ${GEN_LEX_HASH_EXE})
)
ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} gen_lex_hash) ADD_CUSTOM_TARGET(
GenServerSource ALL
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
# ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/message.h
# ${PROJECT_SOURCE_DIR}/sql/message.rc
${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
ADD_DEPENDENCIES(mysqld GenServerSource)
# Remove the auto-generated files as part of 'Clean Solution' # Remove the auto-generated files as part of 'Clean Solution'
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
......
...@@ -20,5 +20,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib ...@@ -20,5 +20,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(archive azio.c ha_archive.cc ha_archive.h)
TARGET_LINK_LIBRARIES(archive zlib mysys dbug strings) SET(ARCHIVE_SOURCES azio.c ha_archive.cc ha_archive.h)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(archive ${ARCHIVE_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ...@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(blackhole ha_blackhole.cc ha_blackhole.h)
SET(BLACKHOLE_SOURCES ha_blackhole.cc ha_blackhole.h)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(blackhole ${BLACKHOLE_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ...@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(csv ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h)
SET(CSV_SOURCES ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(csv ${CSV_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ...@@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(example ha_example.cc)
SET(EXAMPLE_SOURCES ha_example.cc)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(example ${EXAMPLE_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(federated ha_federated.cc)
SET(FEDERATED_SOURCES ha_federated.cc)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(federated ${FEDERATED_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -15,16 +15,18 @@ ...@@ -15,16 +15,18 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(heap _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
SET(HEAP_SOURCES _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
ha_heap.cc ha_heap.cc
hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c
hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c
hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c) hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(heap ${HEAP_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -15,18 +15,16 @@ ...@@ -15,18 +15,16 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB) ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -D_LIB)
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
include ${CMAKE_SOURCE_DIR}/storage/innobase/include
handler ${CMAKE_SOURCE_DIR}/storage/innobase/handler
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
data/data0data.c data/data0type.c data/data0data.c data/data0type.c
dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c
...@@ -57,3 +55,7 @@ ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c ...@@ -57,3 +55,7 @@ ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c
usr/usr0sess.c usr/usr0sess.c
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c) ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(innobase ${INNOBASE_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -16,16 +16,13 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") ...@@ -16,16 +16,13 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(myisam ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
ha_myisam.cc ha_myisam.cc
ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c
mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c
...@@ -37,21 +34,27 @@ ADD_LIBRARY(myisam ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c f ...@@ -37,21 +34,27 @@ ADD_LIBRARY(myisam ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c f
mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c
rt_split.c sort.c sp_key.c ft_eval.h myisamdef.h rt_index.h mi_rkey.c) rt_split.c sort.c sp_key.c ft_eval.h myisamdef.h rt_index.h mi_rkey.c)
ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c) IF(NOT SOURCE_SUBLIBS)
TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys debug dbug strings zlib wsock32)
ADD_LIBRARY(myisam ${MYISAM_SOURCES})
ADD_EXECUTABLE(myisamchk myisamchk.c) ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c)
TARGET_LINK_LIBRARIES(myisamchk myisam mysys debug dbug strings zlib wsock32) TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(myisamlog myisamlog.c) ADD_EXECUTABLE(myisamchk myisamchk.c)
TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32) TARGET_LINK_LIBRARIES(myisamchk myisam mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(myisampack myisampack.c) ADD_EXECUTABLE(myisamlog myisamlog.c)
TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32) TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32)
IF(EMBED_MANIFESTS) ADD_EXECUTABLE(myisampack myisampack.c)
TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker") MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker")
MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker") MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker")
MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker") MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker")
MYSQL_EMBED_MANIFEST("myisampack" "asInvoker") MYSQL_EMBED_MANIFEST("myisampack" "asInvoker")
ENDIF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS)
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -15,17 +15,19 @@ ...@@ -15,17 +15,19 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(myisammrg myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c
SET(MYISAMMRG_SOURCES myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c
ha_myisammrg.cc ha_myisammrg.cc
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c
myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c
myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
myrg_write.c) myrg_write.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(myisammrg ${MYISAMMRG_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -17,7 +17,8 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE ...@@ -17,7 +17,8 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(strings bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c int2str.c ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c int2str.c
...@@ -25,3 +26,7 @@ ADD_LIBRARY(strings bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ...@@ -25,3 +26,7 @@ ADD_LIBRARY(strings bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c
str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
strtod.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c strtod.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c
my_strchr.c strcont.c strinstr.c strnlen.c) my_strchr.c strcont.c strinstr.c strnlen.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(strings ${STRINGS_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -18,4 +18,10 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUT ...@@ -18,4 +18,10 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUT
ADD_DEFINITIONS(-DUSE_SYMDIR) ADD_DEFINITIONS(-DUSE_SYMDIR)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(vio vio.c viosocket.c viossl.c viosslfactories.c)
SET(VIO_SOURCES vio.c viosocket.c viossl.c viosslfactories.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(vio ${VIO_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -65,9 +65,8 @@ The options right now are: ...@@ -65,9 +65,8 @@ The options right now are:
EMBED_MANIFESTS Embed custom manifests into final exes, otherwise VS EMBED_MANIFESTS Embed custom manifests into final exes, otherwise VS
default will be used. (Note - This option should only be default will be used. (Note - This option should only be
used by MySQL AB.) used by MySQL AB.)
EMBEDDED_ONLY Configure solution to produce libmysqld.dll WITH_EMBEDDED_SERVER Configure solution to produce libmysqld.dll
default will be used. and the static mysqlserver.lib
So the command line could look like: So the command line could look like:
...@@ -100,16 +99,3 @@ may be necessary to clean the build tree to remove any stale objects. ...@@ -100,16 +99,3 @@ may be necessary to clean the build tree to remove any stale objects.
Please see this link: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ Please see this link: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
At step 5 you only need to add the libraries advapi32.lib and user32.lib to At step 5 you only need to add the libraries advapi32.lib and user32.lib to
the file "corewin_express.vsprops" in order to avoid link errors. the file "corewin_express.vsprops" in order to avoid link errors.
3. Testing the Windows embedded library requires a two step process. The extra
step is necessary because the testsuite requires mysqld to run properly but both
the embedded library and the mysqld executable cannot be built at the same time.
Here's the process for building and testing the embedded library:
A. Follow steps 1 - 7 listed above to produce the Release configuration.
B. Perform step 5 from above again adding "--EMBEDDED-ONLY" to previously
supplied options.
C. Complete the build steps above to produce the Release configuration. Make
sure to Rebuild the solution so that all libraries are re-built.
D. Run the testsuite as usual.
...@@ -47,7 +47,7 @@ try ...@@ -47,7 +47,7 @@ try
case "__NT__": case "__NT__":
case "CYBOZU": case "CYBOZU":
case "EMBED_MANIFESTS": case "EMBED_MANIFESTS":
case "EMBEDDED_ONLY": case "WITH_EMBEDDED_SERVER":
configfile.WriteLine("SET (" + args.Item(i) + " TRUE)"); configfile.WriteLine("SET (" + args.Item(i) + " TRUE)");
break; break;
case "MYSQL_SERVER_SUFFIX": case "MYSQL_SERVER_SUFFIX":
......
...@@ -9,7 +9,7 @@ MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs) ...@@ -9,7 +9,7 @@ MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs)
TARGET ${_target_name} TARGET ${_target_name}
PRE_LINK PRE_LINK
COMMAND cscript.exe COMMAND cscript.exe
ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(TargetName) version=${VERSION} arch=${PROCESSOR_ARCH} exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
COMMENT "Generates the contents of the manifest contents.") COMMENT "Generates the contents of the manifest contents.")
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
TARGET ${_target_name} TARGET ${_target_name}
......
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