Skip to content
Permalink
Browse files
Rocksdb, Windows - better fix for broken WIN32_LEAN_AND_MEAN
(facebook/rocksdb#4344)
Also, disable /permissive- flag if set, it breaks rocksdb compilation
in 10.3 on older versions of Windows 8.1 SDK.
  • Loading branch information
vaintroub committed Sep 5, 2018
1 parent 2676f33 commit 67b87e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
@@ -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}")

0 comments on commit 67b87e1

Please sign in to comment.