summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/abi_check.cmake2
-rw-r--r--cmake/libutils.cmake8
-rw-r--r--cmake/maintainer.cmake4
-rw-r--r--cmake/os/WindowsCache.cmake5
-rw-r--r--config.h.cmake2
-rw-r--r--configure.cmake15
-rw-r--r--extra/yassl/CMakeLists.txt9
-rw-r--r--include/atomic/gcc_builtins.h4
-rw-r--r--include/my_stacktrace.h3
-rw-r--r--plugin/handler_socket/CMakeLists.txt4
-rw-r--r--scripts/CMakeLists.txt26
-rw-r--r--storage/mroonga/vendor/groonga/CMakeLists.txt4
12 files changed, 40 insertions, 46 deletions
diff --git a/cmake/abi_check.cmake b/cmake/abi_check.cmake
index cca595c5635..e8d2737f116 100644
--- a/cmake/abi_check.cmake
+++ b/cmake/abi_check.cmake
@@ -28,7 +28,7 @@ ELSE()
SET(RUN_ABI_CHECK 0)
ENDIF()
-IF(CMAKE_COMPILER_IS_GNUCC AND RUN_ABI_CHECK)
+IF(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang" AND RUN_ABI_CHECK)
IF(CMAKE_C_COMPILER MATCHES "ccache$")
SET(COMPILER ${CMAKE_C_COMPILER_ARG1})
STRING(REGEX REPLACE "^ " "" COMPILER ${COMPILER})
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
index 8fcfe294f17..636737b2083 100644
--- a/cmake/libutils.cmake
+++ b/cmake/libutils.cmake
@@ -308,17 +308,15 @@ INCLUDE(CheckCCompilerFlag)
SET(VISIBILITY_HIDDEN_FLAG)
-IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
+IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
+ SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
+ELSEIF(UNIX)
CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
IF(HAVE_VISIBILITY_HIDDEN)
SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden")
ENDIF()
ENDIF()
-IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
- SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
-ENDIF()
-
# We try to hide the symbols in yassl/zlib to avoid name clashes with
# other libraries like openssl.
FUNCTION(RESTRICT_SYMBOL_EXPORTS target)
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index 625ecb5a221..4fe2546d709 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -41,11 +41,11 @@ IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
ENDIF()
# Set warning flags for GCC/Clang
-IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+IF(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
SET(MY_MAINTAINER_C_WARNINGS "${MY_C_WARNING_FLAGS}")
ENDIF()
# Set warning flags for G++/Clang++
-IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
SET(MY_MAINTAINER_CXX_WARNINGS "${MY_CXX_WARNING_FLAGS}")
ENDIF()
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake
index c75f2e45bf6..b805ec4fb43 100644
--- a/cmake/os/WindowsCache.cmake
+++ b/cmake/os/WindowsCache.cmake
@@ -351,7 +351,6 @@ SET(C_HAS___inline 1 CACHE INTERNAL "")
SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "")
SET(FIONREAD_IN_SYS_FILIO CACHE INTERNAL "")
SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "")
-SET(HAVE_CXXABI_H CACHE INTERNAL "")
SET(HAVE_NDIR_H CACHE INTERNAL "")
SET(HAVE_SYS_NDIR_H CACHE INTERNAL "")
SET(HAVE_SYS_NDIR_H CACHE INTERNAL "")
@@ -371,4 +370,8 @@ SET(HAVE_PTHREAD_ATTR_GETGUARDSIZE CACHE INTERNAL "")
SET(HAVE_UCONTEXT_H CACHE INTERNAL "")
SET(HAVE_SOCKPEERCRED CACHE INTERNAL "")
SET(HAVE_GGDB3 CACHE INTERNAL "")
+SET(HAVE_ABI_CXA_DEMANGLE CACHE INTERNAL "")
+SET(HAVE_GCC_ATOMIC_BUILTINS CACHE INTERNAL "")
+SET(HAVE_GCC_C11_ATOMICS CACHE INTERNAL "")
+SET(HAVE_VISIBILITY_HIDDEN CACHE INTERNAL "")
ENDIF(MSVC)
diff --git a/config.h.cmake b/config.h.cmake
index 9651a833a57..46eed79dfa5 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -27,7 +27,6 @@
#cmakedefine HAVE_BSEARCH 1
#cmakedefine HAVE_CRYPT_H 1
#cmakedefine HAVE_CURSES_H 1
-#cmakedefine HAVE_CXXABI_H 1
#cmakedefine HAVE_BFD_H 1
#cmakedefine HAVE_NCURSES_H 1
#cmakedefine HAVE_NDIR_H 1
@@ -471,6 +470,7 @@
#cmakedefine MY_ATOMIC_MODE_DUMMY 1
#cmakedefine MY_ATOMIC_MODE_RWLOCKS 1
#cmakedefine HAVE_GCC_ATOMIC_BUILTINS 1
+#cmakedefine HAVE_GCC_C11_ATOMICS 1
#cmakedefine HAVE_SOLARIS_ATOMIC 1
#cmakedefine HAVE_DECL_SHM_HUGETLB 1
#cmakedefine HAVE_LARGE_PAGES 1
diff --git a/configure.cmake b/configure.cmake
index 215b0dc32b4..fb127688bd2 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -52,7 +52,7 @@ IF(NOT SYSTEM_TYPE)
ENDIF()
ENDIF()
-IF(CMAKE_COMPILER_IS_GNUCXX)
+IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# MySQL "canonical" GCC flags. At least -fno-rtti flag affects
# ABI and cannot be simply removed.
SET(CMAKE_CXX_FLAGS
@@ -175,7 +175,6 @@ CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H)
CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H)
CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H)
-CHECK_INCLUDE_FILE_CXX (cxxabi.h HAVE_CXXABI_H)
CHECK_INCLUDE_FILES (bfd.h BFD_H_EXISTS)
CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
@@ -874,7 +873,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS)
# Assume regular sprintf
SET(SPRINTFS_RETURNS_INT 1)
-IF(CMAKE_COMPILER_IS_GNUCXX AND HAVE_CXXABI_H)
+IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
CHECK_CXX_SOURCE_COMPILES("
#include <cxxabi.h>
int main(int argc, char **argv)
@@ -946,7 +945,6 @@ SET(SIGNAL_WITH_VIO_CLOSE 1)
MARK_AS_ADVANCED(NO_ALARM)
-IF(CMAKE_COMPILER_IS_GNUCXX)
IF(WITH_ATOMIC_OPS STREQUAL "up")
SET(MY_ATOMIC_MODE_DUMMY 1 CACHE BOOL "Assume single-CPU mode, no concurrency")
ELSEIF(WITH_ATOMIC_OPS STREQUAL "rwlocks")
@@ -977,10 +975,17 @@ ELSEIF(NOT WITH_ATOMIC_OPS)
return 0;
}"
HAVE_GCC_ATOMIC_BUILTINS)
+ CHECK_CXX_SOURCE_COMPILES("
+ int main()
+ {
+ long long int var= 1;
+ long long int *ptr= &var;
+ return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
+ }"
+ HAVE_GCC_C11_ATOMICS)
ELSE()
MESSAGE(FATAL_ERROR "${WITH_ATOMIC_OPS} is not a valid value for WITH_ATOMIC_OPS!")
ENDIF()
-ENDIF()
SET(WITH_ATOMIC_OPS "${WITH_ATOMIC_OPS}" CACHE STRING
"Implement atomic operations using pthread rwlocks (rwlocks); or atomic CPU
diff --git a/extra/yassl/CMakeLists.txt b/extra/yassl/CMakeLists.txt
index 23404a661d6..f3232896c6a 100644
--- a/extra/yassl/CMakeLists.txt
+++ b/extra/yassl/CMakeLists.txt
@@ -20,12 +20,9 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
ADD_DEFINITIONS(${SSL_DEFINES})
-IF(CMAKE_COMPILER_IS_GNUXX)
- #Remove -fno-implicit-templates
- #(yassl sources cannot be compiled with it)
- STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
-${CMAKE_CXX_FLAGS})
-ENDIF()
+#Remove -fno-implicit-templates
+#(yassl sources cannot be compiled with it)
+STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
src/yassl_imp.cpp src/yassl_int.cpp)
diff --git a/include/atomic/gcc_builtins.h b/include/atomic/gcc_builtins.h
index 6e807b3c51c..56a0323aedf 100644
--- a/include/atomic/gcc_builtins.h
+++ b/include/atomic/gcc_builtins.h
@@ -31,8 +31,8 @@
#define make_atomic_store_body(S) *a= v
#define MY_ATOMIC_MODE "gcc-builtins-up"
-#elif defined(__ATOMIC_SEQ_CST)
-#define MY_ATOMIC_MODE "gcc-builtins-smp"
+#elif defined(HAVE_GCC_C11_ATOMICS)
+#define MY_ATOMIC_MODE "gcc-atomics-smp"
#define make_atomic_load_body(S) \
ret= __atomic_load_n(a, __ATOMIC_SEQ_CST)
#define make_atomic_store_body(S) \
diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h
index ad05a7df9ab..fb2525e3a12 100644
--- a/include/my_stacktrace.h
+++ b/include/my_stacktrace.h
@@ -35,8 +35,7 @@
#define HAVE_WRITE_CORE
-#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \
- HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \
+#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && HAVE_ABI_CXA_DEMANGLE && \
HAVE_WEAK_SYMBOL
#define BACKTRACE_DEMANGLE 1
#endif
diff --git a/plugin/handler_socket/CMakeLists.txt b/plugin/handler_socket/CMakeLists.txt
index 358139eda1e..2e7caa80897 100644
--- a/plugin/handler_socket/CMakeLists.txt
+++ b/plugin/handler_socket/CMakeLists.txt
@@ -6,9 +6,7 @@ IF(WIN32)
ENDIF()
#Remove -fno-implicit-templates from compiler flags(handlersocket would not work with it)
-IF(CMAKE_COMPILER_IS_GNUCXX)
- STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-ENDIF()
+STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
INCLUDE_DIRECTORIES(libhsclient)
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index eadd6ae5af0..79d87fcf6be 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -147,22 +147,16 @@ SET(CONFIGURE_LINE "Built using CMake")
# Also required for mysqlbug, autoconf only supports --version so for now we
# just explicitly require GNU
-IF(CMAKE_COMPILER_IS_GNUCC)
- EXECUTE_PROCESS(
- COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version
- COMMAND sed 1q
- OUTPUT_VARIABLE CC_VERSION)
-ELSE()
- SET(CC_VERSION "")
-ENDIF()
-IF(CMAKE_COMPILER_IS_GNUCXX)
- EXECUTE_PROCESS(
- COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version
- COMMAND sed 1q
- OUTPUT_VARIABLE CXX_VERSION)
-ELSE()
- SET(CXX_VERSION "")
-ENDIF()
+EXECUTE_PROCESS(
+ COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version
+ COMMAND sed 1q
+ ERROR_QUIET
+ OUTPUT_VARIABLE CC_VERSION)
+EXECUTE_PROCESS(
+ COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version
+ COMMAND sed 1q
+ ERROR_QUIET
+ OUTPUT_VARIABLE CXX_VERSION)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh
${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY)
diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt
index 85a84f91ef0..f1ca174ed50 100644
--- a/storage/mroonga/vendor/groonga/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/CMakeLists.txt
@@ -168,7 +168,7 @@ macro(check_build_flag flag)
check_cxxflag(${flag})
endmacro()
-if(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX)
check_build_flag("-Wall")
check_build_flag("-Wextra")
check_build_flag("-Wno-unused-but-set-variable")
@@ -201,7 +201,7 @@ endif()
option(GRN_WITH_DEBUG "enable debug build." OFF)
if(GRN_WITH_DEBUG)
- if(CMAKE_COMPILER_IS_GNUCXX)
+ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX)
set(GRN_C_COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS} -g3 -O0")
set(GRN_CXX_COMPILE_FLAGS "${GRN_CXX_COMPILE_FLAGS} -g3 -O0")
endif()