summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authoriggy@alf. <>2007-06-15 14:32:16 -0400
committeriggy@alf. <>2007-06-15 14:32:16 -0400
commitc15a2647a0a4e88612bb3c3aa8d7417860016155 (patch)
treea99e37995345d1f6afa5a8c17d594bb24252f34c /CMakeLists.txt
parent65e47d59db50661f49882fe666d9e1650233d662 (diff)
downloadmariadb-git-c15a2647a0a4e88612bb3c3aa8d7417860016155.tar.gz
Embedded Server doesn't build on Windows.
- Add build configuration parameter EMBEDDED_ONLY which will configure the VS solution to produce only mysql embedded binary. - Make necessary updates to successfully compile solution.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt71
1 files changed, 45 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8b1268e0699..538c5cb122e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,50 +18,64 @@ PROJECT(MySql)
# This reads user configuration, generated by configure.js.
INCLUDE(win/configure.data)
-# Hardcode support for CSV storage engine
-SET(WITH_CSV_STORAGE_ENGINE TRUE)
+# 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"
+#
+IF(NOT EMBEDDED_ONLY)
+ # Hardcode support for CSV storage engine
+ SET(WITH_CSV_STORAGE_ENGINE TRUE)
+ELSE(NOT EMBEDDED_ONLY)
+ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /Od /Ob0 /D NDEBUG" CACHE STRING "No Optimization" FORCE)
+ENDIF(NOT EMBEDDED_ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY)
SET(WITH_HEAP_STORAGE_ENGINE TRUE)
-ADD_DEFINITIONS(-D WITH_HEAP_STORAGE_ENGINE)
+ADD_DEFINITIONS(-DWITH_HEAP_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_heap_plugin")
SET(WITH_MYISAM_STORAGE_ENGINE TRUE)
-ADD_DEFINITIONS(-D WITH_MYISAM_STORAGE_ENGINE)
+ADD_DEFINITIONS(-DWITH_MYISAM_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisam_plugin")
SET(WITH_MYISAMMRG_STORAGE_ENGINE TRUE)
-ADD_DEFINITIONS(-D WITH_MYISAMMRG_STORAGE_ENGINE)
+ADD_DEFINITIONS(-DWITH_MYISAMMRG_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisammrg_plugin")
IF(WITH_ARCHIVE_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_ARCHIVE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_ARCHIVE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_archive_plugin")
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_BLACKHOLE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_BLACKHOLE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_blackhole_plugin")
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_CSV_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_CSV_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_csv_plugin")
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_EXAMPLE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_EXAMPLE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_example_plugin")
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_INNOBASE_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_innobase_plugin")
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
IF(WITH_PARTITION_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_PARTITION_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_PARTITION_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
ENDIF(WITH_PARTITION_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
- ADD_DEFINITIONS(-D WITH_FEDERATED_STORAGE_ENGINE)
+ ADD_DEFINITIONS(-DWITH_FEDERATED_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_federated_plugin")
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
@@ -81,15 +95,15 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh
${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY)
IF(__NT__)
- ADD_DEFINITIONS(-D __NT__)
+ ADD_DEFINITIONS(-D__NT__)
ENDIF(__NT__)
IF(CYBOZU)
- ADD_DEFINITIONS(-D CYBOZU)
+ ADD_DEFINITIONS(-DCYBOZU)
ENDIF(CYBOZU)
# in some places we use DBUG_OFF
-SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D DBUG_OFF")
-SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D DBUG_OFF")
+SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
+SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
@@ -132,7 +146,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
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")
+ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
IF(EMBED_MANIFESTS)
# Search for the Manifest tool. CMake will first search it's defaults
@@ -179,7 +193,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)
@@ -198,11 +212,16 @@ 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)
-ADD_SUBDIRECTORY(tests)
-
-# disable libmysqld until it's fixed, so we can use Cmake 2.2 and 2.4
-#ADD_SUBDIRECTORY(libmysqld)
-#ADD_SUBDIRECTORY(libmysqld/examples)
+# 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)
+ ADD_SUBDIRECTORY(libmysqld)
+ ADD_SUBDIRECTORY(libmysqld/examples)
+ELSE(EMBEDDED_ONLY)
+ ADD_SUBDIRECTORY(client)
+ ADD_SUBDIRECTORY(sql)
+ ADD_SUBDIRECTORY(server-tools/instance-manager)
+ ADD_SUBDIRECTORY(libmysql)
+ ADD_SUBDIRECTORY(tests)
+ENDIF(EMBEDDED_ONLY)