From: kent Date: August 6 2007 9:16pm Subject: bk commit into 5.1 tree (kent:1.2558) BUG#29903 List-Archive: http://lists.mysql.com/commits/32165 X-Bug: 29903 Message-Id: <20070806211606.75294CB84CC@kent-amd64.localdomain> Below is the list of changes that have just been committed into a local 5.1 repository of kent. When kent does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-08-06 23:16:01+02:00, kent@stripped +22 -0 CMakeLists.txt (many), win/README, mysql_manifest.cmake, configure.js: Additional changes for bug#29903 - Changed to do embedded build part as normal build, when WITH_EMBEDDED_SERVER is set. - Allow both normal and debug build with embedded. - Build static embedded library by pointing out all source and compile it all, i.e. not building libraries from libraries, not portable. - Let embedded use generated files from the "sql" directory, added dependencies to make sure built before embedded. - Mark library "dbug" in TARGET_LINK_LIBRARIES() with "debug", so only linked in when debug target is used. - Removed change of target name with "mysqld${MYSQLD_EXE_SUFFIX}", as others can't depend on it, not defined at configure time. Instead set the output file name. - Created work around for bug in CMake 2.4.6 and output names, to set the "mysqld.pdb" name to the same base name. - Set the correct manifest "name" (patch by iggy) CMakeLists.txt@stripped, 2007-08-06 23:14:46+02:00, kent@stripped +9 -25 Changes for embedded and Windows libmysql/CMakeLists.txt@stripped, 2007-08-06 23:14:46+02:00, kent@stripped +13 -12 Changes for embedded and Windows libmysqld/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +133 -94 Changes for embedded and Windows libmysqld/examples/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -6 Changes for embedded and Windows mysys/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +5 -6 Changes for embedded and Windows regex/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -1 Changes for embedded and Windows server-tools/instance-manager/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +1 -1 Changes for embedded and Windows sql/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +63 -46 Changes for embedded and Windows storage/archive/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -2 Changes for embedded and Windows storage/blackhole/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -1 Changes for embedded and Windows storage/csv/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -1 Changes for embedded and Windows storage/example/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -1 Changes for embedded and Windows storage/federated/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -4 Changes for embedded and Windows storage/heap/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -4 Changes for embedded and Windows storage/innobase/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +9 -7 Changes for embedded and Windows storage/myisam/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +23 -20 Changes for embedded and Windows storage/myisammrg/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -4 Changes for embedded and Windows strings/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +6 -1 Changes for embedded and Windows vio/CMakeLists.txt@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +7 -1 Changes for embedded and Windows win/README@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +2 -16 Changes for embedded and Windows win/configure.js@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +1 -1 Changes for embedded and Windows win/mysql_manifest.cmake@stripped, 2007-08-06 23:14:47+02:00, kent@stripped +1 -1 Changes for embedded and Windows diff -Nrup a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt 2007-08-04 08:51:55 +02:00 +++ b/CMakeLists.txt 2007-08-06 23:14:46 +02:00 @@ -21,22 +21,6 @@ INCLUDE(win/configure.data) # Hardcode support for CSV storage engine 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 ${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY) @@ -154,7 +138,9 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studi ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR 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) # Search for the tools (mt, makecat, signtool) necessary for embedding @@ -229,7 +215,7 @@ ADD_SUBDIRECTORY(extra) ADD_SUBDIRECTORY(storage/heap) ADD_SUBDIRECTORY(storage/myisam) ADD_SUBDIRECTORY(storage/myisammrg) - +ADD_SUBDIRECTORY(client) IF(WITH_ARCHIVE_STORAGE_ENGINE) ADD_SUBDIRECTORY(storage/archive) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) @@ -248,13 +234,11 @@ ENDIF(WITH_FEDERATED_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE) ADD_SUBDIRECTORY(storage/innobase) ENDIF(WITH_INNOBASE_STORAGE_ENGINE) +ADD_SUBDIRECTORY(sql) +ADD_SUBDIRECTORY(server-tools/instance-manager) ADD_SUBDIRECTORY(libmysql) -IF(EMBEDDED_ONLY) +ADD_SUBDIRECTORY(tests) +IF(WITH_EMBEDDED_SERVER) ADD_SUBDIRECTORY(libmysqld) ADD_SUBDIRECTORY(libmysqld/examples) -ELSE(EMBEDDED_ONLY) - ADD_SUBDIRECTORY(client) - ADD_SUBDIRECTORY(sql) - ADD_SUBDIRECTORY(server-tools/instance-manager) - ADD_SUBDIRECTORY(tests) -ENDIF(EMBEDDED_ONLY) +ENDIF(WITH_EMBEDDED_SERVER) diff -Nrup a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt --- a/libmysql/CMakeLists.txt 2007-08-04 08:51:55 +02:00 +++ b/libmysql/CMakeLists.txt 2007-08-06 23:14:46 +02:00 @@ -38,6 +38,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ # Include and add the directory path SET(SOURCE_SUBLIBS TRUE) +SET(LIB_SOURCES "") INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt) FOREACH(rpath ${ZLIB_SOURCES}) @@ -118,16 +119,16 @@ ADD_LIBRARY(mysqlclient_notls STATIC ${C ADD_DEPENDENCIES(mysqlclient_notls GenError) 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") - ADD_DEPENDENCIES(libmysql GenError) - TARGET_LINK_LIBRARIES(libmysql wsock32) - - ADD_EXECUTABLE(myTest mytest.c) - TARGET_LINK_LIBRARIES(myTest libmysql) - - IF(EMBED_MANIFESTS) - MYSQL_EMBED_MANIFEST("myTest" "asInvoker") - ENDIF(EMBED_MANIFESTS) -ENDIF(NOT EMBEDDED_ONLY) +ENDIF(WIN32) +ADD_DEPENDENCIES(libmysql GenError) +TARGET_LINK_LIBRARIES(libmysql wsock32) + +ADD_EXECUTABLE(myTest mytest.c) +TARGET_LINK_LIBRARIES(myTest libmysql) + +IF(EMBED_MANIFESTS) + MYSQL_EMBED_MANIFEST("myTest" "asInvoker") +ENDIF(EMBED_MANIFESTS) diff -Nrup a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt --- a/libmysqld/CMakeLists.txt 2007-08-04 03:44:46 +02:00 +++ b/libmysqld/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -18,7 +18,11 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS # Need to set USE_TLS, since __declspec(thread) approach to thread local # 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 ${CMAKE_SOURCE_DIR}/libmysqld @@ -26,18 +30,124 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/extra/yassl/include - ${CMAKE_SOURCE_DIR}/zlib -) + ${CMAKE_SOURCE_DIR}/zlib) + +SET(GEN_SOURCES ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc + ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h + ${CMAKE_SOURCE_DIR}/sql/message.h + ${CMAKE_SOURCE_DIR}/sql/message.rc + ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc + ${CMAKE_SOURCE_DIR}/sql/lex_hash.h) + +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) + +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_FILES_PROPERTIES(sql_yacc.cc - sql_yacc.h - message.h - message.rc - ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc - lex_hash.h - PROPERTIES GENERATED 1) +SET(SOURCE_SUBLIBS FALSE) -ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc +SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c ../sql-common/client.c ../sql-common/my_time.c ../sql-common/my_user.c ../sql-common/pack.c @@ -69,101 +179,30 @@ ADD_LIBRARY(mysqldemb emb_qcache.cc libm ../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_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_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc ../sql/sql_update.cc ../sql/sql_view.cc ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.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 - ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c - ../vio/viosslfactories.c - 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) + ${GEN_SOURCES} + ${LIB_SOURCES}) # Seems we cannot make a library without at least one source file. So use a # dummy empty file FILE(WRITE cmake_dummy.c " ") -ADD_LIBRARY(mysqlserver cmake_dummy.c) -TARGET_LINK_LIBRARIES(mysqlserver wsock32) -ADD_DEPENDENCIES(mysqlserver mysqldemb heap myisam myisammrg dbug mysys zlib strings mysqldemb regex - yassl taocrypt vio) -IF(WITH_ARCHIVE_STORAGE_ENGINE) - ADD_DEPENDENCIES(mysqlserver archive) -ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) -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) +# Tried use the correct ${GEN_SOURCES} as dependency, worked on Unix +# but not on Windows and Visual Studio generators. Likely because they +# are no real targets from the Visual Studio project files view. Added +# custom targets to "sql/CMakeLists.txt" and reference them here. +ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES}) +ADD_DEPENDENCIES(mysqlserver GenServerSource GenError) +TARGET_LINK_LIBRARIES(mysqlserver) ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def) -TARGET_LINK_LIBRARIES(libmysqld wsock32) ADD_DEPENDENCIES(libmysqld mysqlserver) -IF(WITH_ARCHIVE_STORAGE_ENGINE) - 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) +TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32) diff -Nrup a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt --- a/libmysqld/examples/CMakeLists.txt 2007-08-03 20:43:09 +02:00 +++ b/libmysqld/examples/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -15,24 +15,24 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libmysqld/include - ${CMAKE_SOURCE_DIR}/libmysqld/release ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/extra/yassl/include) # Currently does not work with DBUG, there are missing symbols reported. -ADD_DEFINITIONS(-DDBUG_OFF) -ADD_DEFINITIONS(-DUSE_TLS) +IF(WIN32) + ADD_DEFINITIONS(-DUSE_TLS) +ENDIF(WIN32) ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc ../../client/mysql.cc ../../client/readline.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_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_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) diff -Nrup a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt --- a/mysys/CMakeLists.txt 2007-08-03 22:54:44 +02:00 +++ b/mysys/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -23,14 +23,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS # Exception is the embedded server that needs this library compiled with # 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) -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 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 @@ -47,3 +42,7 @@ ADD_LIBRARY(mysys array.c charset-def.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 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) diff -Nrup a/regex/CMakeLists.txt b/regex/CMakeLists.txt --- a/regex/CMakeLists.txt 2007-07-31 19:34:32 +02:00 +++ b/regex/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -17,4 +17,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_F SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX") 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) diff -Nrup a/server-tools/instance-manager/CMakeLists.txt b/server-tools/instance-manager/CMakeLists.txt --- a/server-tools/instance-manager/CMakeLists.txt 2007-08-03 22:55:14 +02:00 +++ b/server-tools/instance-manager/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -24,7 +24,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR 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 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 ../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c diff -Nrup a/sql/CMakeLists.txt b/sql/CMakeLists.txt --- a/sql/CMakeLists.txt 2007-08-03 22:55:30 +02:00 +++ b/sql/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -28,9 +28,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ ) SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc - ${CMAKE_SOURCE_DIR}/sql/message.h - ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h - ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc + ${CMAKE_SOURCE_DIR}/sql/message.h + ${CMAKE_SOURCE_DIR}/sql/sql_yacc.h + ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc ${CMAKE_SOURCE_DIR}/include/mysql_version.h ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc ${CMAKE_SOURCE_DIR}/sql/lex_hash.h @@ -41,8 +41,8 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOUR ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN) -ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX} - ../sql-common/client.c derror.cc des_key_file.cc +ADD_EXECUTABLE(mysqld + ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc filesort.cc gstream.cc ha_partition.cc @@ -74,74 +74,91 @@ ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX sql_tablespace.cc events.cc ../sql-common/my_user.c partition_info.cc rpl_utility.cc rpl_injector.cc sql_locale.cc rpl_rli.cc rpl_mi.cc sql_servers.cc - sql_connect.cc scheduler.cc + sql_connect.cc scheduler.cc ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc - ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h - ${PROJECT_SOURCE_DIR}/include/mysqld_error.h - ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h - ${PROJECT_SOURCE_DIR}/include/sql_state.h - ${PROJECT_SOURCE_DIR}/include/mysql_version.h - ${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc - ${PROJECT_SOURCE_DIR}/sql/lex_hash.h) -TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} - heap myisam myisammrg mysys yassl zlib debug dbug yassl + ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h + ${PROJECT_SOURCE_DIR}/include/mysqld_error.h + ${PROJECT_SOURCE_DIR}/include/mysqld_ername.h + ${PROJECT_SOURCE_DIR}/include/sql_state.h + ${PROJECT_SOURCE_DIR}/include/mysql_version.h + ${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc + ${PROJECT_SOURCE_DIR}/sql/lex_hash.h) + +TARGET_LINK_LIBRARIES(mysqld + heap myisam myisammrg mysys yassl zlib debug dbug yassl 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) MYSQL_EMBED_MANIFEST("mysqld" "asInvoker") ENDIF(EMBED_MANIFESTS) IF(WITH_ARCHIVE_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} archive) + TARGET_LINK_LIBRARIES(mysqld archive) ENDIF(WITH_ARCHIVE_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) IF(WITH_CSV_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} csv) + TARGET_LINK_LIBRARIES(mysqld csv) ENDIF(WITH_CSV_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) IF(WITH_FEDERATED_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} federated) + TARGET_LINK_LIBRARIES(mysqld federated) ENDIF(WITH_FEDERATED_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) -ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} GenError) +ADD_DEPENDENCIES(mysqld GenError) -# Sql Parser custom command -ADD_CUSTOM_COMMAND( - SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy - OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc - COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h - --output=sql_yacc.cc sql_yacc.yy - DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy) +# 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 ADD_CUSTOM_COMMAND( - OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h - COMMAND echo - DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc -) - -# Windows message file -ADD_CUSTOM_COMMAND( - SOURCE message.mc - OUTPUT message.rc message.h - COMMAND mc ARGS message.mc - DEPENDS message.mc) + OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h +# ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc + COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h + --output=sql_yacc.cc sql_yacc.yy + DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy) + +IF(WIN32) + # Windows message file + ADD_CUSTOM_COMMAND( + OUTPUT ${PROJECT_SOURCE_DIR}/sql/message.h +# ${PROJECT_SOURCE_DIR}/sql/message.rc + COMMAND mc ARGS message.mc + DEPENDS ${PROJECT_SOURCE_DIR}/sql/message.mc) +ENDIF(WIN32) # Gen_lex_hash 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) ADD_CUSTOM_COMMAND( - OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h - COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h - DEPENDS ${GEN_LEX_HASH_EXE} -) -ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} gen_lex_hash) + OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h + COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h + DEPENDS ${GEN_LEX_HASH_EXE}) + +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' SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES diff -Nrup a/storage/archive/CMakeLists.txt b/storage/archive/CMakeLists.txt --- a/storage/archive/CMakeLists.txt 2006-12-31 01:37:58 +01:00 +++ b/storage/archive/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -20,5 +20,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${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) diff -Nrup a/storage/blackhole/CMakeLists.txt b/storage/blackhole/CMakeLists.txt --- a/storage/blackhole/CMakeLists.txt 2006-12-31 01:37:58 +01:00 +++ b/storage/blackhole/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${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) diff -Nrup a/storage/csv/CMakeLists.txt b/storage/csv/CMakeLists.txt --- a/storage/csv/CMakeLists.txt 2007-01-04 19:54:46 +01:00 +++ b/storage/csv/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${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) diff -Nrup a/storage/example/CMakeLists.txt b/storage/example/CMakeLists.txt --- a/storage/example/CMakeLists.txt 2006-12-31 01:37:58 +01:00 +++ b/storage/example/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -19,4 +19,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${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) diff -Nrup a/storage/federated/CMakeLists.txt b/storage/federated/CMakeLists.txt --- a/storage/federated/CMakeLists.txt 2007-06-15 20:32:01 +02:00 +++ b/storage/federated/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -15,11 +15,13 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_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 ${CMAKE_SOURCE_DIR}/regex ${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) diff -Nrup a/storage/heap/CMakeLists.txt b/storage/heap/CMakeLists.txt --- a/storage/heap/CMakeLists.txt 2007-07-31 19:34:32 +02:00 +++ b/storage/heap/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -15,16 +15,18 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_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 ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${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 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_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) diff -Nrup a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt --- a/storage/innobase/CMakeLists.txt 2007-07-31 19:34:32 +02:00 +++ b/storage/innobase/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -15,18 +15,16 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_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) -IF(EMBEDDED_ONLY) - ADD_DEFINITIONS(-DUSE_TLS) -ENDIF(EMBEDDED_ONLY) +ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -D_LIB) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib - include - handler + ${CMAKE_SOURCE_DIR}/storage/innobase/include + ${CMAKE_SOURCE_DIR}/storage/innobase/handler ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${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 data/data0data.c data/data0type.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/b trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.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) + +IF(NOT SOURCE_SUBLIBS) + ADD_LIBRARY(innobase ${INNOBASE_SOURCES}) +ENDIF(NOT SOURCE_SUBLIBS) diff -Nrup a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt --- a/storage/myisam/CMakeLists.txt 2007-08-03 22:55:37 +02:00 +++ b/storage/myisam/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -16,16 +16,13 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_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 ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${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 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 @@ -37,21 +34,27 @@ ADD_LIBRARY(myisam ft_boolean_search.c f 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) -ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c) -TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys debug dbug strings zlib wsock32) +IF(NOT SOURCE_SUBLIBS) + + ADD_LIBRARY(myisam ${MYISAM_SOURCES}) + + ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c) + TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys debug dbug strings zlib wsock32) + + ADD_EXECUTABLE(myisamchk myisamchk.c) + TARGET_LINK_LIBRARIES(myisamchk myisam mysys debug dbug strings zlib wsock32) + + ADD_EXECUTABLE(myisamlog myisamlog.c) + TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32) -ADD_EXECUTABLE(myisamchk myisamchk.c) -TARGET_LINK_LIBRARIES(myisamchk myisam mysys debug dbug strings zlib wsock32) + ADD_EXECUTABLE(myisampack myisampack.c) + TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32) -ADD_EXECUTABLE(myisamlog myisamlog.c) -TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32) + IF(EMBED_MANIFESTS) + MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker") + MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker") + MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker") + MYSQL_EMBED_MANIFEST("myisampack" "asInvoker") + ENDIF(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("myisamchk" "asInvoker") - MYSQL_EMBED_MANIFEST("myisamlog" "asInvoker") - MYSQL_EMBED_MANIFEST("myisampack" "asInvoker") -ENDIF(EMBED_MANIFESTS) +ENDIF(NOT SOURCE_SUBLIBS) diff -Nrup a/storage/myisammrg/CMakeLists.txt b/storage/myisammrg/CMakeLists.txt --- a/storage/myisammrg/CMakeLists.txt 2007-07-31 19:34:32 +02:00 +++ b/storage/myisammrg/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -15,17 +15,19 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_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 ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex ${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 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_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c myrg_write.c) + +IF(NOT SOURCE_SUBLIBS) + ADD_LIBRARY(myisammrg ${MYISAMMRG_SOURCES}) +ENDIF(NOT SOURCE_SUBLIBS) diff -Nrup a/strings/CMakeLists.txt b/strings/CMakeLists.txt --- a/strings/CMakeLists.txt 2007-07-31 19:34:32 +02:00 +++ b/strings/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -17,7 +17,8 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_F SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX") 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-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 @@ -25,3 +26,7 @@ ADD_LIBRARY(strings bchange.c bcmp.c bfi 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 my_strchr.c strcont.c strinstr.c strnlen.c) + +IF(NOT SOURCE_SUBLIBS) + ADD_LIBRARY(strings ${STRINGS_SOURCES}) +ENDIF(NOT SOURCE_SUBLIBS) diff -Nrup a/vio/CMakeLists.txt b/vio/CMakeLists.txt --- a/vio/CMakeLists.txt 2007-07-31 19:03:49 +02:00 +++ b/vio/CMakeLists.txt 2007-08-06 23:14:47 +02:00 @@ -18,4 +18,10 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS ADD_DEFINITIONS(-DUSE_SYMDIR) 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) + diff -Nrup a/win/README b/win/README --- a/win/README 2007-08-03 20:43:09 +02:00 +++ b/win/README 2007-08-06 23:14:47 +02:00 @@ -65,10 +65,9 @@ The options right now are: EMBED_MANIFESTS Embed custom manifests into final exes, otherwise VS default will be used. (Note - This option should only be used by MySQL AB.) - EMBEDDED_ONLY Configure solution to produce libmysqld.dll - default will be used. + WITH_EMBEDDED_SERVER Configure solution to produce libmysqld.dll + and the static mysqlserver.lib - So the command line could look like: win\configure WITH_INNOBASE_STORAGE_ENGINE WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro @@ -100,16 +99,3 @@ may be necessary to clean the build tree 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 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. - diff -Nrup a/win/configure.js b/win/configure.js --- a/win/configure.js 2007-07-18 15:52:51 +02:00 +++ b/win/configure.js 2007-08-06 23:14:47 +02:00 @@ -47,7 +47,7 @@ try case "__NT__": case "CYBOZU": case "EMBED_MANIFESTS": - case "EMBEDDED_ONLY": + case "WITH_EMBEDDED_SERVER": configfile.WriteLine("SET (" + args.Item(i) + " TRUE)"); break; case "MYSQL_SERVER_SUFFIX": diff -Nrup a/win/mysql_manifest.cmake b/win/mysql_manifest.cmake --- a/win/mysql_manifest.cmake 2007-07-25 19:18:10 +02:00 +++ b/win/mysql_manifest.cmake 2007-08-06 23:14:47 +02:00 @@ -9,7 +9,7 @@ MACRO(MYSQL_EMBED_MANIFEST _target_name TARGET ${_target_name} PRE_LINK 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.") ADD_CUSTOM_COMMAND( TARGET ${_target_name}