summaryrefslogtreecommitdiff
path: root/sql/CMakeLists.txt
diff options
context:
space:
mode:
authorunknown <kent@mysql.com/kent-amd64.(none)>2007-08-06 23:16:01 +0200
committerunknown <kent@mysql.com/kent-amd64.(none)>2007-08-06 23:16:01 +0200
commit1337c429fb559242bcafb3ca29de65dfa48a89d5 (patch)
tree7b218053b942a53e4c500c94ca3a1c0d7464d859 /sql/CMakeLists.txt
parente4d449a655ac16d43642cf5d57769c68468c979b (diff)
downloadmariadb-git-1337c429fb559242bcafb3ca29de65dfa48a89d5.tar.gz
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<suffix>.pdb" name to the same base name. - Set the correct manifest "name" (patch by iggy) CMakeLists.txt: Changes for embedded and Windows libmysql/CMakeLists.txt: Changes for embedded and Windows libmysqld/CMakeLists.txt: Changes for embedded and Windows libmysqld/examples/CMakeLists.txt: Changes for embedded and Windows mysys/CMakeLists.txt: Changes for embedded and Windows regex/CMakeLists.txt: Changes for embedded and Windows server-tools/instance-manager/CMakeLists.txt: Changes for embedded and Windows sql/CMakeLists.txt: Changes for embedded and Windows storage/archive/CMakeLists.txt: Changes for embedded and Windows storage/blackhole/CMakeLists.txt: Changes for embedded and Windows storage/csv/CMakeLists.txt: Changes for embedded and Windows storage/example/CMakeLists.txt: Changes for embedded and Windows storage/federated/CMakeLists.txt: Changes for embedded and Windows storage/heap/CMakeLists.txt: Changes for embedded and Windows storage/innobase/CMakeLists.txt: Changes for embedded and Windows storage/myisam/CMakeLists.txt: Changes for embedded and Windows storage/myisammrg/CMakeLists.txt: Changes for embedded and Windows strings/CMakeLists.txt: Changes for embedded and Windows vio/CMakeLists.txt: Changes for embedded and Windows win/README: Changes for embedded and Windows win/configure.js: Changes for embedded and Windows win/mysql_manifest.cmake: Changes for embedded and Windows
Diffstat (limited to 'sql/CMakeLists.txt')
-rwxr-xr-xsql/CMakeLists.txt107
1 files changed, 62 insertions, 45 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 1400c1487d0..a0c00e868e5 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -28,9 +28,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
)
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_SOURCE_DIR}/sql/message.rc
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)
+
+# 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(
- 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)
+ 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)
-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)
+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