Commit 67b87e1d authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Rocksdb, Windows - better fix for broken WIN32_LEAN_AND_MEAN

(https://github.com/facebook/rocksdb/issues/4344)
Also, disable /permissive- flag if set, it breaks rocksdb compilation
in 10.3 on older versions of Windows 8.1 SDK.
parent 2676f337
......@@ -43,15 +43,6 @@ IF (WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
SKIP_ROCKSDB_PLUGIN("32-Bit Windows are temporarily disabled")
ENDIF()
#
# RocksDB's port/win/env_win.cc uses parts of Windows API that are not part
# of the LEAN_AND_MEAN set. Ideally we should undef LEAN_AND_MEAN only for
# that file, but REMOVE_DEFINITIONS only works per-directory?
#
IF (WIN32)
REMOVE_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
ENDIF()
# This plugin needs recent C++ compilers (it is using C++11 features)
# Skip build for the old compilers
SET(CXX11_FLAGS)
......
......@@ -385,6 +385,13 @@ ENDFOREACH()
if(MSVC)
add_definitions(-DHAVE_SSE42 -DHAVE_PCLMUL)
# Workaround broken compilation with -DWIN32_LEAN_AND_MEAN
# (https://github.com/facebook/rocksdb/issues/4344)
set_source_files_properties(${ROCKSDB_SOURCE_DIR}/port/win/env_win.cc
PROPERTIES COMPILE_FLAGS "/FI\"windows.h\" /FI\"winioctl.h\"")
# Workaround Win8.1 SDK bug, that breaks /permissive-
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_REQUIRED_FLAGS "-msse4.2 -mpclmul ${CXX11_FLAGS}")
......
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