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

Build cleanups.

Fix clang-cl built
parent bb8df685
......@@ -115,7 +115,7 @@ ENDIF()
# Add version information to the exe and dll files
# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
# 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>
# to bzr revno for example (in the CI builds)
IF(NOT TINY_VERSION)
......
......@@ -46,6 +46,10 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
SET(MSVC TRUE)
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_WIN32_WINNT=0x0A00)
# We do not want the windows.h macros min/max
......@@ -60,7 +64,7 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)
ENDIF()
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")
ENDIF()
# currently, asan is broken with static CRT.
......@@ -141,7 +145,7 @@ IF(MSVC)
ENDIF()
ENDFOREACH()
IF(CMAKE_CXX_COMPILER_ID MATCHES Clang)
IF(CLANG_CL)
SET(CLANG_CL_FLAGS
"-Wno-unknown-warning-option -Wno-unused-private-field \
-Wno-unused-parameter -Wno-inconsistent-missing-override \
......@@ -173,7 +177,7 @@ IF(MSVC)
ENDIF()
# 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_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF()
......@@ -181,13 +185,14 @@ IF(MSVC)
#TODO: update the code and remove the disabled warnings
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")
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-")
ENDIF()
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
MESSAGE("MEH")
FOREACH(type EXE SHARED MODULE)
FOREACH(cfg RELEASE DEBUG RELWITHDEBINFO)
SET(CMAKE_${type}_LINKER_FLAGS_${cfg} "${CMAKE_${type}_LINKER_FLAGS_${cfg}} /WX")
......@@ -198,7 +203,7 @@ IF(MSVC)
# Noisy warning C4800: 'type': forcing value to bool 'true' or 'false' (performance warning),
# removed in VS2017
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")
ENDIF()
ENDIF()
......
......@@ -229,8 +229,8 @@ parameters are declared in mysqld.cc: */
long innobase_buffer_pool_awe_mem_mb = 0;
long innobase_file_io_threads = 4;
long innobase_read_io_threads = 4;
long innobase_write_io_threads = 4;
ulong innobase_read_io_threads = 4;
ulong innobase_write_io_threads = 4;
longlong innobase_page_size = (1LL << 14); /* 16KB */
char* innobase_buffer_pool_filename = NULL;
......@@ -1879,8 +1879,8 @@ static bool innodb_init_param()
srv_buf_pool_chunk_unit = (ulong)srv_buf_pool_size;
srv_n_file_io_threads = (ulint) innobase_file_io_threads;
srv_n_read_io_threads = (ulint) innobase_read_io_threads;
srv_n_write_io_threads = (ulint) innobase_write_io_threads;
srv_n_read_io_threads = innobase_read_io_threads;
srv_n_write_io_threads = innobase_write_io_threads;
srv_max_n_open_files = ULINT_UNDEFINED - 5;
......@@ -3803,7 +3803,7 @@ static ulong xb_set_max_open_files(rlim_t max_file_limit)
return static_cast<ulong>(max_file_limit);
}
#else
# define xb_set_max_open_files(x) 0
# define xb_set_max_open_files(x) 0UL
#endif
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