diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/libutils.cmake | 12 | ||||
-rw-r--r-- | cmake/os/Windows.cmake | 5 | ||||
-rw-r--r-- | cmake/plugin.cmake | 3 | ||||
-rw-r--r-- | cmake/zlib.cmake | 18 |
4 files changed, 17 insertions, 21 deletions
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 41b7d9d1d86..67e222eefb0 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -136,6 +136,10 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE) SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.c) ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE}) SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}) + IF(NOT _SKIP_PIC) + SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS + "${CMAKE_SHARED_LIBRARY_C_FLAGS}") + ENDIF() SET(OSLIBS) FOREACH(LIB ${LIBS_TO_MERGE}) @@ -240,11 +244,11 @@ MACRO(MERGE_LIBRARIES) # check for non-PIC libraries IF(NOT _SKIP_PIC) FOREACH(LIB ${LIBS}) - GET_TARGET_PROPERTY(${LIB} TYPE LIBTYPE) - IF(LIBTYPE STREQUAL "STATIC_LIBRARY") - GET_TARGET_PROPERTY(LIB COMPILE_FLAGS LIB_COMPILE_FLAGS) + GET_TARGET_PROPERTY(LTYPE ${LIB} TYPE) + IF(LTYPE STREQUAL "STATIC_LIBRARY") + GET_TARGET_PROPERTY(LIB_COMPILE_FLAGS ${LIB} COMPILE_FLAGS) STRING(REPLACE "${CMAKE_SHARED_LIBRARY_C_FLAGS}" - "<PIC_FLAG>" LIB_COMPILE_FLAGS ${LIB_COMPILE_FLAG}) + "<PIC_FLAG>" LIB_COMPILE_FLAGS "${LIB_COMPILE_FLAGS}") IF(NOT LIB_COMPILE_FLAGS MATCHES "<PIC_FLAG>") MESSAGE(FATAL_ERROR "Attempted to link non-PIC static library ${LIB} to shared library ${TARGET}\n" diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 283f79b3b41..ea5084ebba6 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -132,9 +132,8 @@ IF(MSVC) ENDIF() # Always link with socket library -LINK_LIBRARIES(ws2_32) -# ..also for tests -SET(CMAKE_REQUIRED_LIBRARIES ws2_32) +STRING(APPEND CMAKE_C_STANDARD_LIBRARIES " ws2_32.lib") +STRING(APPEND CMAKE_CXX_STANDARD_LIBRARIES " ws2_32.lib") # System checks SET(SIGNAL_WITH_VIO_CLOSE 1) # Something that runtime team needs diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 0072ac1c0e2..438c631e9e8 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -1,4 +1,5 @@ -# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2018, Oracle and/or its affiliates. +# Copyright (c) 2011, 2018, MariaDB Corporation # # 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 diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake index c70d0e29ecf..840337d1ca3 100644 --- a/cmake/zlib.cmake +++ b/cmake/zlib.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2018, 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 @@ -14,15 +14,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA MACRO (MYSQL_USE_BUNDLED_ZLIB) - SET(ZLIB_LIBRARY zlib) - SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib) + SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_BINARY_DIR}/zlib) + SET(BUILD_BUNDLED_ZLIB 1) + SET(ZLIB_LIBRARY zlib CACHE INTERNAL "Bundled zlib library") SET(ZLIB_FOUND TRUE) SET(WITH_ZLIB "bundled" CACHE STRING "Use bundled zlib") ADD_SUBDIRECTORY(zlib) - GET_TARGET_PROPERTY(src zlib SOURCES) - FOREACH(file ${src}) - SET(ZLIB_SOURCES ${ZLIB_SOURCES} ${CMAKE_SOURCE_DIR}/zlib/${file}) - ENDFOREACH() ENDMACRO() # MYSQL_CHECK_ZLIB_WITH_COMPRESS @@ -37,15 +34,10 @@ ENDMACRO() MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS) - IF(CMAKE_SYSTEM_NAME STREQUAL "OS400" OR - CMAKE_SYSTEM_NAME STREQUAL "AIX" OR - CMAKE_SYSTEM_NAME STREQUAL "Windows") - # Use bundled zlib on some platforms by default (system one is too - # old or not existent) + # For NDBCLUSTER: Use bundled zlib by default IF (NOT WITH_ZLIB) SET(WITH_ZLIB "bundled" CACHE STRING "By default use bundled zlib on this platform") ENDIF() - ENDIF() IF(WITH_ZLIB STREQUAL "bundled") MYSQL_USE_BUNDLED_ZLIB() |