diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-09-05 19:32:31 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-09-05 19:32:31 +0100 |
commit | 67b87e1d76a3ecaacb1606d8ddcc1f67f4b7faf6 (patch) | |
tree | 0628e77d8b43b8be7d5a411e83a006265478f093 | |
parent | 2676f3371cc18cf9f33b24accf3949a590c1fec8 (diff) | |
download | mariadb-git-67b87e1d76a3ecaacb1606d8ddcc1f67f4b7faf6.tar.gz |
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.
-rw-r--r-- | storage/rocksdb/CMakeLists.txt | 9 | ||||
-rw-r--r-- | storage/rocksdb/build_rocksdb.cmake | 7 |
2 files changed, 7 insertions, 9 deletions
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 7aab8034b07..2689dc7151c 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -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) diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake index f09024ef800..93f5fa2d1f3 100644 --- a/storage/rocksdb/build_rocksdb.cmake +++ b/storage/rocksdb/build_rocksdb.cmake @@ -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}") |