Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Tiny AES C
Commits
139cebe4
Commit
139cebe4
authored
Jan 31, 2019
by
Torfinn Berset
Browse files
Add Conan package options
parent
cd1db241
Changes
2
Show whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
139cebe4
...
@@ -6,11 +6,4 @@ add_library(tiny-aes
...
@@ -6,11 +6,4 @@ add_library(tiny-aes
aes.c
aes.c
)
)
target_compile_definitions
(
tiny-aes PRIVATE
-DAES128=1
-DCBC=1
-DECB=1
-DCTR=1
)
target_include_directories
(
tiny-aes PRIVATE tiny-AES-c/
)
target_include_directories
(
tiny-aes PRIVATE tiny-AES-c/
)
conanfile.py
View file @
139cebe4
...
@@ -12,17 +12,52 @@ class TinyAesCConan(ConanFile):
...
@@ -12,17 +12,52 @@ class TinyAesCConan(ConanFile):
settings
=
"os"
,
"compiler"
,
"build_type"
,
"arch"
settings
=
"os"
,
"compiler"
,
"build_type"
,
"arch"
generators
=
"cmake"
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
):
def
build
(
self
):
cmake
=
CMake
(
self
)
cmake
=
CMake
(
self
)
for
key
in
self
.
_options_dict
.
keys
():
if
self
.
options
[
key
]:
cmake
.
definitions
[
"CMAKE_CFLAGS"
].
append
(
key
)
cmake
.
configure
()
cmake
.
configure
()
cmake
.
build
()
cmake
.
build
()
def
package
(
self
):
def
package
(
self
):
self
.
copy
(
"*.h"
,
dst
=
"include"
)
self
.
copy
(
"*.h"
,
dst
=
"include"
)
self
.
copy
(
"*.hpp"
,
dst
=
"include"
)
self
.
copy
(
"*.hpp"
,
dst
=
"include"
)
self
.
copy
(
"*.a"
,
dst
=
"lib"
,
keep_path
=
False
)
self
.
copy
(
"*.a"
,
dst
=
"lib"
,
keep_path
=
False
)
def
package_info
(
self
):
def
package_info
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment