summaryrefslogtreecommitdiffstats
path: root/conanfile.py
diff options
context:
space:
mode:
authorTorfinn Berset <torfinn@bloom-life.com>2019-01-31 14:11:26 +0100
committerTorfinn Berset <torfinn@bloom-life.com>2019-01-31 14:11:26 +0100
commit139cebe407a32f5cbed3ebe409ded69e681d02d3 (patch)
treeed06a227a272e9626469c734c34fdb5ad7704c83 /conanfile.py
parentFirst version of Conan recipe (diff)
downloadtiny-AES-c-139cebe407a32f5cbed3ebe409ded69e681d02d3.tar
tiny-AES-c-139cebe407a32f5cbed3ebe409ded69e681d02d3.tar.gz
tiny-AES-c-139cebe407a32f5cbed3ebe409ded69e681d02d3.tar.bz2
tiny-AES-c-139cebe407a32f5cbed3ebe409ded69e681d02d3.tar.lz
tiny-AES-c-139cebe407a32f5cbed3ebe409ded69e681d02d3.tar.xz
tiny-AES-c-139cebe407a32f5cbed3ebe409ded69e681d02d3.tar.zst
tiny-AES-c-139cebe407a32f5cbed3ebe409ded69e681d02d3.zip
Diffstat (limited to '')
-rw-r--r--conanfile.py39
1 files changed, 37 insertions, 2 deletions
diff --git a/conanfile.py b/conanfile.py
index 019c3cb..f3a2a9c 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -12,17 +12,52 @@ class TinyAesCConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
- exports_sources = ["CMakeLists.txt", "*.c", '*.h', '*.h']
+ exports_sources = ["CMakeLists.txt", "*.c", '*.h', '*.hpp']
+
+ _options_dict = {
+ # enable AES128
+ "AES128": [True, False],
+
+ # enable AES192
+ "AES192": [True, False],
+
+ # enable AES256
+ "AES256": [True, False],
+
+ # enable AES encryption in CBC-mode of operation
+ "CBC": [True, False],
+
+ # enable the basic ECB 16-byte block algorithm
+ "ECB": [True, False],
+
+ # enable encryption in counter-mode
+ "CTR": [True, False],
+ }
+
+ options = _options_dict
+
+ default_options = {
+ "AES128": True,
+ "AES192": False,
+ "AES256": False,
+ "CBC": False,
+ "ECB": False,
+ "CTR": False
+ }
def build(self):
cmake = CMake(self)
+
+ for key in self._options_dict.keys():
+ if self.options[key]:
+ cmake.definitions["CMAKE_CFLAGS"].append(key)
+
cmake.configure()
cmake.build()
def package(self):
self.copy("*.h", dst="include")
self.copy("*.hpp", dst="include")
-
self.copy("*.a", dst="lib", keep_path=False)
def package_info(self):