summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rwxr-xr-xextra/CMakeLists.txt42
-rw-r--r--extra/libevent/CMakeLists.txt13
-rw-r--r--extra/libevent/event.h2
-rw-r--r--extra/libevent/evutil.h17
-rw-r--r--extra/my_print_defaults.c2
5 files changed, 36 insertions, 40 deletions
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index 6cc69d3251e..adb357cf790 100755
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -22,34 +22,36 @@ TARGET_LINK_LIBRARIES(comp_err debug dbug mysys strings zlib wsock32)
GET_TARGET_PROPERTY(COMP_ERR_EXE comp_err LOCATION)
-ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
- COMMAND ${COMP_ERR_EXE}
- --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
- --out-dir=${PROJECT_SOURCE_DIR}/sql/share/
- --header_file=${PROJECT_SOURCE_DIR}/include/mysqld_error.h
- --name_file=${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
- --state_file=${PROJECT_SOURCE_DIR}/include/sql_state.h
- --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt
- DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt)
+# Generate mysqld_error.h
+# Try not to change its timestamp if not necessary(as touching
+# mysqld_error.h results in rebuild of the almost whole server)
+# To preserve timestamp, first generate a temp header file, then copy it
+# to mysqld_error.h using cmake -E copy_if_different
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
+ COMMAND ${COMP_ERR_EXE}
+ --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.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 ${PROJECT_SOURCE_DIR}/include/mysqld_error.h)
+ 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)
-
-IF(EMBED_MANIFESTS)
- MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
-ENDIF(EMBED_MANIFESTS)
-
-INSTALL(TARGETS comp_err my_print_defaults perror resolveip replace DESTINATION bin COMPONENT runtime)
diff --git a/extra/libevent/CMakeLists.txt b/extra/libevent/CMakeLists.txt
index 66961502357..6be15641d3e 100644
--- a/extra/libevent/CMakeLists.txt
+++ b/extra/libevent/CMakeLists.txt
@@ -1,7 +1,10 @@
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/extra/libevent
${CMAKE_SOURCE_DIR}/extra/libevent/compat
- ${CMAKE_SOURCE_DIR}/extra/libevent/WIN32-Code)
+ ${CMAKE_SOURCE_DIR}/extra/libevent/WIN32-Code
+ ${CMAKE_BINARY_DIR}/extra/libevent
+ ${CMAKE_SOURCE_DIR}/include
+)
IF(MSVC)
ADD_DEFINITIONS("-DWIN32 -DHAVE_CONFIG_H")
@@ -27,8 +30,14 @@ SET(LIBEVENT_SOURCES
min_heap.h
strlcpy-internal.h
)
+IF(WIN32)
+ # Workaround source distribution bug, remove preconfigured event-config
+ IF(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+ FILE(REMOVE ${CMAKE_SOURCE_DIR}/extra/libevent/event-config.h)
+ ENDIF()
+ CONFIGURE_FILE(WIN32-Code/config.h ${CMAKE_BINARY_DIR}/extra/libevent/event-config.h COPYONLY)
+ENDIF()
-CONFIGURE_FILE(WIN32-Code/config.h ${CMAKE_SOURCE_DIR}/extra/libevent/event-config.h COPYONLY)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(libevent ${LIBEVENT_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/extra/libevent/event.h b/extra/libevent/event.h
index 451ca895e2b..078c940770e 100644
--- a/extra/libevent/event.h
+++ b/extra/libevent/event.h
@@ -159,6 +159,8 @@
extern "C" {
#endif
+#include <my_attribute.h>
+
#include <event-config.h>
#ifdef _EVENT_HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/extra/libevent/evutil.h b/extra/libevent/evutil.h
index 46e4079715d..2cfcacb2e0e 100644
--- a/extra/libevent/evutil.h
+++ b/extra/libevent/evutil.h
@@ -171,21 +171,4 @@ ev_int64_t evutil_strtoll(const char *s, char **endptr, int base);
}
#endif
-/* Define __attribute__ for platforms that doesn't suppor it */
-
-#ifndef __attribute__
-# if !defined(__GNUC__)
-# define __attribute__(A)
-# else
-# ifndef GCC_VERSION
-# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-# endif
-# if GCC_VERSION < 2008
-# define __attribute__(A)
-# elif defined(__cplusplus) && GCC_VERSION < 3004
-# define __attribute__(A)
-# endif
-# endif
-#endif
-
#endif /* _EVUTIL_H_ */
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index e6b3d6dffc8..9f856b816ed 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -106,7 +106,7 @@ static void usage(my_bool version)
my_print_help(my_long_options);
my_print_default_files(config_file);
my_print_variables(my_long_options);
- printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname);
+ printf("\nExample usage:\n%s --defaults-file=example.cnf client client-server mysql\n", my_progname);
}
#include <help_end.h>