diff --git a/recipes/rocksdb/all/conanfile.py b/recipes/rocksdb/all/conanfile.py index 6156446d2926ff..e06389e185ea8e 100644 --- a/recipes/rocksdb/all/conanfile.py +++ b/recipes/rocksdb/all/conanfile.py @@ -1,4 +1,6 @@ from conans import ConanFile, CMake, tools +from conans.tools import Version +from conans.errors import ConanInvalidConfiguration import os @@ -24,7 +26,7 @@ class RocksDB(ConanFile): } default_options = { "shared": False, - "fPIC": False, + "fPIC": True, "lite": False, "with_snappy": False, "with_lz4": False, @@ -48,6 +50,12 @@ def config_options(self): if self.settings.os == "Windows": del self.options.fPIC + def configure(self): + if self.settings.os == "Windows" and \ + self.settings.compiler == "Visual Studio" and \ + Version(self.settings.compiler.version) < "15": + raise ConanInvalidConfiguration("Rocksdb requires Visual Studio 15 or later.") + def source(self): tools.get(**self.conan_data["sources"][self.version]) extracted_dir = "rocksdb-" + self.version