Skip to content

Commit 1b58ef7

Browse files
committed
Build cleanups.
Fix clang-cl built
1 parent bb8df68 commit 1b58ef7

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

cmake/mysql_version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ ENDIF()
115115
# Add version information to the exe and dll files
116116
# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
117117
# for more info.
118-
IF(MSVC)
118+
IF(MSVC AND NOT CLANG_CL)
119119
# Tiny version is used to identify the build, it can be set with cmake -DTINY_VERSION=<number>
120120
# to bzr revno for example (in the CI builds)
121121
IF(NOT TINY_VERSION)

cmake/os/Windows.cmake

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
4646
SET(MSVC TRUE)
4747
ENDIF()
4848

49+
IF(MSVC AND CMAKE_CXX_COMPILER_ID MATCHES Clang)
50+
SET(CLANG_CL TRUE)
51+
ENDIF()
52+
4953
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE)
5054
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0A00)
5155
# We do not want the windows.h macros min/max
@@ -60,7 +64,7 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)
6064
ENDIF()
6165

6266
FUNCTION(ENABLE_ASAN)
63-
IF(NOT (MSVC AND CMAKE_CXX_COMPILER_ID MATCHES Clang))
67+
IF(NOT CLANG_CL)
6468
MESSAGE(FATAL_ERROR "clang-cl is necessary to enable asan")
6569
ENDIF()
6670
# currently, asan is broken with static CRT.
@@ -141,7 +145,7 @@ IF(MSVC)
141145
ENDIF()
142146
ENDFOREACH()
143147

144-
IF(CMAKE_CXX_COMPILER_ID MATCHES Clang)
148+
IF(CLANG_CL)
145149
SET(CLANG_CL_FLAGS
146150
"-Wno-unknown-warning-option -Wno-unused-private-field \
147151
-Wno-unused-parameter -Wno-inconsistent-missing-override \
@@ -173,21 +177,22 @@ IF(MSVC)
173177
ENDIF()
174178

175179
# Speed up multiprocessor build
176-
IF (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
180+
IF (NOT CLANG_CL)
177181
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
178182
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
179183
ENDIF()
180184

181185
#TODO: update the code and remove the disabled warnings
182186
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4700 /we4311 /we4477 /we4302 /we4090")
183187
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
184-
IF(MSVC_VERSION GREATER 1910 AND (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang))
188+
IF(MSVC_VERSION GREATER 1910 AND NOT CLANG_CL)
185189
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
186190
ENDIF()
187191
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)
188192
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
189193
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
190194
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
195+
MESSAGE("MEH")
191196
FOREACH(type EXE SHARED MODULE)
192197
FOREACH(cfg RELEASE DEBUG RELWITHDEBINFO)
193198
SET(CMAKE_${type}_LINKER_FLAGS_${cfg} "${CMAKE_${type}_LINKER_FLAGS_${cfg}} /WX")
@@ -198,7 +203,7 @@ IF(MSVC)
198203
# Noisy warning C4800: 'type': forcing value to bool 'true' or 'false' (performance warning),
199204
# removed in VS2017
200205
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800")
201-
ELSEIF (NOT (CMAKE_CXX_COMPILER_ID MATCHES Clang))
206+
ELSEIF (NOT CLANG_CL)
202207
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /d2OptimizeHugeFunctions")
203208
ENDIF()
204209
ENDIF()

extra/mariabackup/xtrabackup.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ parameters are declared in mysqld.cc: */
229229

230230
long innobase_buffer_pool_awe_mem_mb = 0;
231231
long innobase_file_io_threads = 4;
232-
long innobase_read_io_threads = 4;
233-
long innobase_write_io_threads = 4;
232+
ulong innobase_read_io_threads = 4;
233+
ulong innobase_write_io_threads = 4;
234234

235235
longlong innobase_page_size = (1LL << 14); /* 16KB */
236236
char* innobase_buffer_pool_filename = NULL;
@@ -1879,8 +1879,8 @@ static bool innodb_init_param()
18791879
srv_buf_pool_chunk_unit = (ulong)srv_buf_pool_size;
18801880

18811881
srv_n_file_io_threads = (ulint) innobase_file_io_threads;
1882-
srv_n_read_io_threads = (ulint) innobase_read_io_threads;
1883-
srv_n_write_io_threads = (ulint) innobase_write_io_threads;
1882+
srv_n_read_io_threads = innobase_read_io_threads;
1883+
srv_n_write_io_threads = innobase_write_io_threads;
18841884

18851885
srv_max_n_open_files = ULINT_UNDEFINED - 5;
18861886

@@ -3803,7 +3803,7 @@ static ulong xb_set_max_open_files(rlim_t max_file_limit)
38033803
return static_cast<ulong>(max_file_limit);
38043804
}
38053805
#else
3806-
# define xb_set_max_open_files(x) 0
3806+
# define xb_set_max_open_files(x) 0UL
38073807
#endif
38083808

38093809
static void stop_backup_threads()

0 commit comments

Comments
 (0)