diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2014-02-04 15:34:36 +0100 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2014-02-04 15:34:36 +0100 |
commit | 288f1ce10977bc88ab2c81e9a45a9809d2ccfa65 (patch) | |
tree | 34958c61202ed94b22891db08789629d9a7f4a13 /libmysqld | |
parent | 82d0ac9d2377415a9df0b589f399ddd8863f788f (diff) | |
download | mariadb-git-288f1ce10977bc88ab2c81e9a45a9809d2ccfa65.tar.gz |
Bug#18123048 ENABLE BUILD OF SHARED LIBMYSQLD ON LINUX
Added a new option: WITH_EMBEDDED_SHARED_LIBRARY
Diffstat (limited to 'libmysqld')
-rw-r--r-- | libmysqld/CMakeLists.txt | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index eaf14b8a65a..f31aa819ed5 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -143,3 +143,37 @@ IF(MSVC AND NOT DISABLE_SHARED) MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} COMPONENT Embedded) ENDIF() + +OPTION(WITH_EMBEDDED_SHARED_LIBRARY + "Generate shared version of embedded library (in addition to the static one)" + OFF) +IF(WITH_EMBEDDED_SHARED_LIBRARY) + MERGE_LIBRARIES(libmysqld SHARED + mysqlserver + EXPORTS ${CLIENT_API_FUNCTIONS} + OUTPUT_NAME "mysqld" + COMPONENT Embedded) + SET_TARGET_PROPERTIES(libmysqld PROPERTIES + VERSION "${SHARED_LIB_MAJOR_VERSION}.${SHARED_LIB_MINOR_VERSION}.0" + SOVERSION "${SHARED_LIB_MAJOR_VERSION}" + ) + + GET_TARGET_PROPERTY(libmysqld_link_flags libmysqld LINK_FLAGS) + IF(NOT libmysqld_link_flag) + SET(libmysqld_link_flags) + ENDIF() + SET(libmysqld_link_flags + "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${libmysqld_link_flags}") + SET_TARGET_PROPERTIES(libmysqld + PROPERTIES LINK_FLAGS "${libmysqld_link_flags}") + + IF(LINK_FLAG_NO_UNDEFINED) + SET(libmysqld_link_flags + "${libmysqld_link_flags} ${LINK_FLAG_NO_UNDEFINED}") + SET_TARGET_PROPERTIES(libmysqld + PROPERTIES LINK_FLAGS "${libmysqld_link_flags}") + ENDIF() + + SET_TARGET_PROPERTIES(libmysqld PROPERTIES CLEAN_DIRECT_OUTPUT 1) + SET_TARGET_PROPERTIES(mysqlserver PROPERTIES CLEAN_DIRECT_OUTPUT 1) +ENDIF() |