summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-05-15 13:38:18 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2011-05-15 13:38:18 +0200
commit19f0d6b2d9930f83688943b8f98a8b7397584df9 (patch)
tree08c9b040b07dfcf337c7a94244b0dd5ff5ccb7ff
parent2982738e48cf47162251d318c44b13801ea4804f (diff)
downloadmariadb-git-19f0d6b2d9930f83688943b8f98a8b7397584df9.tar.gz
Small CMake fixes :
- add version info for the client library, dynamic plugins and some utilities - do not recompile client library sources 3 times (for mysqlclient , mysqlclient_notls and libmysql) One time is sufficient, so get rid of mysqlclient_notls, and link static client library to the shared. - remove incremental linking flag
-rwxr-xr-xCMakeLists.txt10
-rwxr-xr-xclient/CMakeLists.txt18
-rwxr-xr-xextra/CMakeLists.txt16
-rwxr-xr-xlibmysql/CMakeLists.txt10
-rw-r--r--storage/mysql_storage_engine.cmake1
-rwxr-xr-xtests/CMakeLists.txt4
6 files changed, 25 insertions, 34 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3dc753f1a85..3c6a65505fe 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -171,15 +171,7 @@ IF(MSVC)
IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 4)
-
- # Disable automatic manifest generation.
- STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
- ${CMAKE_EXE_LINKER_FLAGS})
- # Explicitly disable it since it is the default for newer versions of VS
- STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
- IF(NOT tmp_manifest)
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
- ENDIF(NOT tmp_manifest)
+ SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL:NO")
ENDIF(MSVC)
IF(WIN32)
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 4105922fa90..ecfd3a0f0ce 100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -14,7 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-# We use the "mysqlclient_notls" library here just as safety, in case
+# We use the "mysqlclient" library here just as safety, in case
# any of the clients here would go beyond the client API and access the
# Thread Local Storage directly.
@@ -29,27 +29,27 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR})
MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c DESTINATION bin)
-TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysql mysqlclient wsock32)
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc DESTINATION bin)
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex wsock32 dbug)
MYSQL_ADD_EXECUTABLE(mysqlcheck mysqlcheck.c DESTINATION bin)
-TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient wsock32)
MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c ../mysys/mf_getdate.c DESTINATION bin)
-TARGET_LINK_LIBRARIES(mysqldump mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqldump mysqlclient wsock32)
MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c DESTINATION bin)
-TARGET_LINK_LIBRARIES(mysqlimport mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqlimport mysqlclient wsock32)
MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c DESTINATION bin)
-TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient wsock32)
ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c DESTINATION bin)
-TARGET_LINK_LIBRARIES(mysqlshow mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqlshow mysqlclient wsock32)
MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc
../mysys/mf_tempdir.c
@@ -59,10 +59,10 @@ MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc
../mysys/my_vle.c
../mysys/base64.c
DESTINATION bin)
-TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient wsock32)
MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc DESTINATION bin)
-TARGET_LINK_LIBRARIES(mysqladmin mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysqladmin mysqlclient wsock32)
MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c DESTINATION bin)
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index 15194556a6b..adb357cf790 100755
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -32,26 +32,26 @@ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
--charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
--out-dir=${CMAKE_BINARY_DIR}/sql/share/
--header_file=${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
- --name_file=${CMAKE_BINARY_DIR}/include/mysqld_ername.h
- --state_file=${CMAKE_BINARY_DIR}/include/sql_state.h
+ --name_file=${CMAKE_BINARY_DIR}/include/mysqld_ername.h.tmp
+ --state_file=${CMAKE_BINARY_DIR}/include/sql_state.h.tmp
--in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp ${CMAKE_BINARY_DIR}/include/mysqld_error.h
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/mysqld_ername.h.tmp ${CMAKE_BINARY_DIR}/include/mysqld_ername.h
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/sql_state.h.tmp ${CMAKE_BINARY_DIR}/include/sql_state.h
DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt)
ADD_CUSTOM_TARGET(GenError
ALL
DEPENDS ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp)
-ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
+MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
TARGET_LINK_LIBRARIES(my_print_defaults strings mysys debug dbug taocrypt wsock32)
-ADD_EXECUTABLE(perror perror.c)
+MYSQL_ADD_EXECUTABLE(perror perror.c)
TARGET_LINK_LIBRARIES(perror strings mysys debug dbug wsock32)
-ADD_EXECUTABLE(resolveip resolveip.c)
+MYSQL_ADD_EXECUTABLE(resolveip resolveip.c)
TARGET_LINK_LIBRARIES(resolveip strings mysys debug dbug wsock32)
-ADD_EXECUTABLE(replace replace.c)
+MYSQL_ADD_EXECUTABLE(replace replace.c COMPONENT Server)
TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)
-
-MYSQL_INSTALL_TARGETS(comp_err my_print_defaults perror resolveip replace DESTINATION bin COMPONENT Server)
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index c748f9b073f..4ac0b9a01ee 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -110,18 +110,16 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
ADD_LIBRARY(mysqlclient STATIC ${CLIENT_SOURCES})
ADD_DEPENDENCIES(mysqlclient GenError)
-TARGET_LINK_LIBRARIES(mysqlclient)
-ADD_LIBRARY(mysqlclient_notls STATIC ${CLIENT_SOURCES})
-ADD_DEPENDENCIES(mysqlclient_notls GenError)
-TARGET_LINK_LIBRARIES(mysqlclient_notls)
+SET(SHARED_SOURCES dll.c libmysql.def)
+ADD_VERSION_INFO(libmysql SHARED SHARED_SOURCES)
+ADD_LIBRARY(libmysql SHARED ${SHARED_SOURCES})
-ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} dll.c libmysql.def)
IF(WIN32)
SET_TARGET_PROPERTIES(libmysql mysqlclient PROPERTIES COMPILE_FLAGS "-DUSE_TLS")
ENDIF(WIN32)
ADD_DEPENDENCIES(libmysql GenError)
-TARGET_LINK_LIBRARIES(libmysql wsock32)
+TARGET_LINK_LIBRARIES(libmysql mysqlclient ws2_32)
ADD_DEFINITIONS(-DHAVE_DLOPEN)
MYSQL_INSTALL_TARGETS(mysqlclient DESTINATION lib COMPONENT Development)
diff --git a/storage/mysql_storage_engine.cmake b/storage/mysql_storage_engine.cmake
index e500526350b..07b4151c50c 100644
--- a/storage/mysql_storage_engine.cmake
+++ b/storage/mysql_storage_engine.cmake
@@ -36,6 +36,7 @@ IF(NOT SOURCE_SUBLIBS)
#Create a DLL.The name of the dll is ha_<storage_engine>.dll
#The dll is linked to the mysqld executable
SET(dyn_libname ha_${libname})
+ ADD_VERSION_INFO(${dyn_libname} SHARED ${engine}_SOURCES)
ADD_LIBRARY(${dyn_libname} MODULE ${${engine}_SOURCES})
TARGET_LINK_LIBRARIES (${dyn_libname} mysqlservices mysqld)
IF(${engine}_LIBS)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 4095f2ec342..967ebae2e22 100755
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -20,9 +20,9 @@ ADD_DEFINITIONS("-DMYSQL_CLIENT")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_EXECUTABLE(mysql_client_test mysql_client_test.c ../mysys/my_memmem.c)
-TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient wsock32)
ADD_EXECUTABLE(bug25714 bug25714.c)
-TARGET_LINK_LIBRARIES(bug25714 mysqlclient_notls wsock32)
+TARGET_LINK_LIBRARIES(bug25714 mysqlclient wsock32)
INSTALL(TARGETS mysql_client_test DESTINATION bin COMPONENT Test)