Commit 1b58ef7d authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Build cleanups.

Fix clang-cl built
parent bb8df685
...@@ -115,7 +115,7 @@ ENDIF() ...@@ -115,7 +115,7 @@ ENDIF()
# Add version information to the exe and dll files # Add version information to the exe and dll files
# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx # Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
# for more info. # for more info.
IF(MSVC) IF(MSVC AND NOT CLANG_CL)
# Tiny version is used to identify the build, it can be set with cmake -DTINY_VERSION=<number> # Tiny version is used to identify the build, it can be set with cmake -DTINY_VERSION=<number>
# to bzr revno for example (in the CI builds) # to bzr revno for example (in the CI builds)
IF(NOT TINY_VERSION) IF(NOT TINY_VERSION)
......
...@@ -46,6 +46,10 @@ IF(CMAKE_C_COMPILER MATCHES "icl") ...@@ -46,6 +46,10 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
SET(MSVC TRUE) SET(MSVC TRUE)
ENDIF() ENDIF()
IF(MSVC AND CMAKE_CXX_COMPILER_ID MATCHES Clang)
SET(CLANG_CL TRUE)
ENDIF()
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE) ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0A00) ADD_DEFINITIONS(-D_WIN32_WINNT=0x0A00)
# We do not want the windows.h macros min/max # We do not want the windows.h macros min/max
...@@ -60,7 +64,7 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4) ...@@ -60,7 +64,7 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)
ENDIF() ENDIF()
FUNCTION(ENABLE_ASAN) FUNCTION(ENABLE_ASAN)
IF(NOT (MSVC AND CMAKE_CXX_COMPILER_ID MATCHES Clang)) IF(NOT CLANG_CL)
MESSAGE(FATAL_ERROR "clang-cl is necessary to enable asan") MESSAGE(FATAL_ERROR "clang-cl is necessary to enable asan")
ENDIF() ENDIF()
# currently, asan is broken with static CRT. # currently, asan is broken with static CRT.
...@@ -141,7 +145,7 @@ IF(MSVC) ...@@ -141,7 +145,7 @@ IF(MSVC)
ENDIF() ENDIF()
ENDFOREACH() ENDFOREACH()
IF(CMAKE_CXX_COMPILER_ID MATCHES Clang) IF(CLANG_CL)
SET(CLANG_CL_FLAGS SET(CLANG_CL_FLAGS
"-Wno-unknown-warning-option -Wno-unused-private-field \ "-Wno-unknown-warning-option -Wno-unused-private-field \
-Wno-unused-parameter -Wno-inconsistent-missing-override \ -Wno-unused-parameter -Wno-inconsistent-missing-override \
...@@ -173,7 +177,7 @@ IF(MSVC) ...@@ -173,7 +177,7 @@ IF(MSVC)
ENDIF() ENDIF()
# Speed up multiprocessor build # Speed up multiprocessor build
IF (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang) IF (NOT CLANG_CL)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF() ENDIF()
...@@ -181,13 +185,14 @@ IF(MSVC) ...@@ -181,13 +185,14 @@ IF(MSVC)
#TODO: update the code and remove the disabled warnings #TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4700 /we4311 /we4477 /we4302 /we4090") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4700 /we4311 /we4477 /we4302 /we4090")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4099 /we4700 /we4311 /we4477 /we4302 /we4090") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
IF(MSVC_VERSION GREATER 1910 AND (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)) IF(MSVC_VERSION GREATER 1910 AND NOT CLANG_CL)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
ENDIF() ENDIF()
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS) ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR") IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
MESSAGE("MEH")
FOREACH(type EXE SHARED MODULE) FOREACH(type EXE SHARED MODULE)
FOREACH(cfg RELEASE DEBUG RELWITHDEBINFO) FOREACH(cfg RELEASE DEBUG RELWITHDEBINFO)
SET(CMAKE_${type}_LINKER_FLAGS_${cfg} "${CMAKE_${type}_LINKER_FLAGS_${cfg}} /WX") SET(CMAKE_${type}_LINKER_FLAGS_${cfg} "${CMAKE_${type}_LINKER_FLAGS_${cfg}} /WX")
...@@ -198,7 +203,7 @@ IF(MSVC) ...@@ -198,7 +203,7 @@ IF(MSVC)
# Noisy warning C4800: 'type': forcing value to bool 'true' or 'false' (performance warning), # Noisy warning C4800: 'type': forcing value to bool 'true' or 'false' (performance warning),
# removed in VS2017 # removed in VS2017
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800")
ELSEIF (NOT (CMAKE_CXX_COMPILER_ID MATCHES Clang)) ELSEIF (NOT CLANG_CL)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /d2OptimizeHugeFunctions") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /d2OptimizeHugeFunctions")
ENDIF() ENDIF()
ENDIF() ENDIF()
......
...@@ -229,8 +229,8 @@ parameters are declared in mysqld.cc: */ ...@@ -229,8 +229,8 @@ parameters are declared in mysqld.cc: */
long innobase_buffer_pool_awe_mem_mb = 0; long innobase_buffer_pool_awe_mem_mb = 0;
long innobase_file_io_threads = 4; long innobase_file_io_threads = 4;
long innobase_read_io_threads = 4; ulong innobase_read_io_threads = 4;
long innobase_write_io_threads = 4; ulong innobase_write_io_threads = 4;
longlong innobase_page_size = (1LL << 14); /* 16KB */ longlong innobase_page_size = (1LL << 14); /* 16KB */
char* innobase_buffer_pool_filename = NULL; char* innobase_buffer_pool_filename = NULL;
...@@ -1879,8 +1879,8 @@ static bool innodb_init_param() ...@@ -1879,8 +1879,8 @@ static bool innodb_init_param()
srv_buf_pool_chunk_unit = (ulong)srv_buf_pool_size; srv_buf_pool_chunk_unit = (ulong)srv_buf_pool_size;
srv_n_file_io_threads = (ulint) innobase_file_io_threads; srv_n_file_io_threads = (ulint) innobase_file_io_threads;
srv_n_read_io_threads = (ulint) innobase_read_io_threads; srv_n_read_io_threads = innobase_read_io_threads;
srv_n_write_io_threads = (ulint) innobase_write_io_threads; srv_n_write_io_threads = innobase_write_io_threads;
srv_max_n_open_files = ULINT_UNDEFINED - 5; srv_max_n_open_files = ULINT_UNDEFINED - 5;
...@@ -3803,7 +3803,7 @@ static ulong xb_set_max_open_files(rlim_t max_file_limit) ...@@ -3803,7 +3803,7 @@ static ulong xb_set_max_open_files(rlim_t max_file_limit)
return static_cast<ulong>(max_file_limit); return static_cast<ulong>(max_file_limit);
} }
#else #else
# define xb_set_max_open_files(x) 0 # define xb_set_max_open_files(x) 0UL
#endif #endif
static void stop_backup_threads() static void stop_backup_threads()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment