mirror of
https://github.com/kokke/tiny-AES-c
synced 2024-11-21 21:11:58 +03:00
First version of Conan recipe
This commit is contained in:
parent
2c88f70a20
commit
cd1db241ad
16
CMakeLists.txt
Normal file
16
CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
project(tinyaes C ASM)
|
||||
|
||||
add_library(tiny-aes
|
||||
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/)
|
29
conanfile.py
Normal file
29
conanfile.py
Normal file
@ -0,0 +1,29 @@
|
||||
from conans import ConanFile, CMake
|
||||
|
||||
|
||||
class TinyAesCConan(ConanFile):
|
||||
name = "tiny-AES-c"
|
||||
version = "1.0.0"
|
||||
license = "MIT"
|
||||
author = "Torfinn Berset <torfinn@bloomlife.com>"
|
||||
url = "https://github.com/kokke/tiny-AES-c"
|
||||
description = "Small portable AES128/192/256 in C"
|
||||
topics = ("encryption", "crypto", "AES")
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
|
||||
generators = "cmake"
|
||||
exports_sources = ["CMakeLists.txt", "*.c", '*.h', '*.h']
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
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):
|
||||
self.cpp_info.libs = ["tiny-aes"]
|
8
test_package/CMakeLists.txt
Normal file
8
test_package/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(TinyAesPackageTest C)
|
||||
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
|
||||
add_executable(example ../test.c)
|
||||
target_link_libraries(example ${CONAN_LIBS})
|
17
test_package/conanfile.py
Normal file
17
test_package/conanfile.py
Normal file
@ -0,0 +1,17 @@
|
||||
from conans import ConanFile, CMake, tools
|
||||
import os
|
||||
|
||||
|
||||
class TinyAesCTestConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
generators = "cmake"
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def test(self):
|
||||
if not tools.cross_building(self.settings):
|
||||
os.chdir("bin")
|
||||
self.run(".%sexample" % os.sep)
|
Loading…
Reference in New Issue
Block a user