1+ from conans import ConanFile , CMake
2+ from conan .tools .cmake import CMakeToolchain
3+ import os
4+
5+ class Coro19Conan (ConanFile ):
6+ name = "coro19"
7+ version = "1.0"
8+
9+ # Optional metadata
10+ license = "MIT License"
11+ author = "Hicknhack Software"
12+ url = "https://github.com/basicpp17/co-cpp19"
13+ description = "C++17/20 Library with the fastest runtime and compile times"
14+ topics = ("algorithm" , "container" , "common" , "utility" )
15+ generators = "cmake_find_package" , "cmake"
16+ # Binary configuration
17+ settings = "os" , "compiler" , "build_type" , "arch"
18+ options = {"shared" : [True , False ], "fPIC" : [True , False ]}
19+ default_options = {"shared" : False , "fPIC" : True }
20+
21+ def export_sources (self ):
22+ self .copy ("CMakeLists.txt" )
23+ self .copy ("*" , src = "coro19" , dst = "coro19" )
24+
25+ def config_options (self ):
26+ if self .settings .os == "Windows" :
27+ del self .options .fPIC
28+
29+ def generate (self ):
30+ tc = CMakeToolchain (self )
31+ tc .generate ()
32+
33+ def build (self ):
34+ cmake = CMake (self )
35+ cmake .configure ()
36+ cmake .build ()
37+
38+ def package (self ):
39+ self .copy ("*.h" , dst = "include" )
40+ self .copy ("*.lib" , dst = "lib" , keep_path = False )
41+ self .copy ("*.dll" , dst = "bin" , keep_path = False )
42+ self .copy ("*.so" , dst = "lib" , keep_path = False )
43+ self .copy ("*.dylib" , dst = "lib" , keep_path = False )
44+ self .copy ("*.a" , dst = "lib" , keep_path = False )
45+
46+ def package_info (self ):
47+ postfix = "d" if self .settings .build_type == "Debug" else ""
48+ self .cpp_info .libs = ["coro19" + postfix ]
0 commit comments