Skip to content

Commit

Permalink
sqlitecpp: Add has_codec option
Browse files Browse the repository at this point in the history
This enable the database encryption support
  • Loading branch information
Alex-PLACET committed Feb 16, 2024
1 parent 1c4fc7d commit f4e1ab6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion recipes/sqlitecpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ class SQLiteCppConan(ConanFile):
"shared": [True, False],
"fPIC": [True, False],
"stack_protection": [True, False],
"has_codec": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"stack_protection": True,
"has_codec": False,
}

def export_sources(self):
Expand All @@ -41,9 +43,14 @@ def config_options(self):
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
if self.options.has_codec:
self.options["sqlcipher"].enable_column_metadata = True

def requirements(self):
self.requires("sqlite3/3.45.0")
if self.options.has_codec:
self.requires("sqlcipher/[>=4.5.6]")
else:
self.requires("sqlite3/3.45.0")

def validate(self):
if Version(self.version) >= "3.0.0" and self.info.settings.compiler.get_safe("cppstd"):
Expand Down Expand Up @@ -78,6 +85,7 @@ def generate(self):
tc.variables["SQLITECPP_BUILD_EXAMPLES"] = False
tc.variables["SQLITECPP_BUILD_TESTS"] = False
tc.variables["SQLITECPP_USE_STACK_PROTECTION"] = self.options.stack_protection
tc.variables["SQLITE_HAS_CODEC"] = self.options.has_codec
tc.generate()

tc = CMakeDeps(self)
Expand Down

0 comments on commit f4e1ab6

Please sign in to comment.