Skip to content

Commit 67b87e1

Browse files
committed
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.
1 parent 2676f33 commit 67b87e1

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

storage/rocksdb/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ IF (WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
4343
SKIP_ROCKSDB_PLUGIN("32-Bit Windows are temporarily disabled")
4444
ENDIF()
4545

46-
#
47-
# RocksDB's port/win/env_win.cc uses parts of Windows API that are not part
48-
# of the LEAN_AND_MEAN set. Ideally we should undef LEAN_AND_MEAN only for
49-
# that file, but REMOVE_DEFINITIONS only works per-directory?
50-
#
51-
IF (WIN32)
52-
REMOVE_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
53-
ENDIF()
54-
5546
# This plugin needs recent C++ compilers (it is using C++11 features)
5647
# Skip build for the old compilers
5748
SET(CXX11_FLAGS)

storage/rocksdb/build_rocksdb.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,13 @@ ENDFOREACH()
385385

386386
if(MSVC)
387387
add_definitions(-DHAVE_SSE42 -DHAVE_PCLMUL)
388+
# Workaround broken compilation with -DWIN32_LEAN_AND_MEAN
389+
# (https://github.com/facebook/rocksdb/issues/4344)
390+
set_source_files_properties(${ROCKSDB_SOURCE_DIR}/port/win/env_win.cc
391+
PROPERTIES COMPILE_FLAGS "/FI\"windows.h\" /FI\"winioctl.h\"")
392+
393+
# Workaround Win8.1 SDK bug, that breaks /permissive-
394+
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
388395
else()
389396
set(CMAKE_REQUIRED_FLAGS "-msse4.2 -mpclmul ${CXX11_FLAGS}")
390397

0 commit comments

Comments
 (0)