Skip to content

Commit

Permalink
modernize more
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Apr 18, 2023
1 parent e87d650 commit ca045fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
24 changes: 8 additions & 16 deletions recipes/aws-c-http/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
import os

required_conan_version = ">=1.47.0"
required_conan_version = ">=1.53.0"


class AwsCHttp(ConanFile):
name = "aws-c-http"
description = "C99 implementation of the HTTP/1.1 and HTTP/2 specifications"
license = "Apache-2.0",
license = "Apache-2.0"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/awslabs/aws-c-http"
topics = ("aws", "amazon", "cloud", "http", "http2", )
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand All @@ -29,18 +31,9 @@ def config_options(self):

def configure(self):
if self.options.shared:
try:
del self.options.fPIC
except Exception:
pass
try:
del self.settings.compiler.libcxx
except Exception:
pass
try:
del self.settings.compiler.cppstd
except Exception:
pass
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")

def layout(self):
cmake_layout(self, src_folder="src")
Expand All @@ -54,8 +47,7 @@ def requirements(self):
self.requires("aws-c-io/0.13.4")

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
Expand Down
9 changes: 3 additions & 6 deletions recipes/aws-c-http/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
cmake_minimum_required(VERSION 3.1)

project(test_package C)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(aws-c-http REQUIRED CONFIG)

add_executable(${PROJECT_NAME} ../test_package/test_package.c)
target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-c-http)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)

0 comments on commit ca045fa

Please sign in to comment.