Skip to content

Commit

Permalink
modern-cpp-kafka: validate cppstd
Browse files Browse the repository at this point in the history
  • Loading branch information
kenneth-jia committed Jul 19, 2022
1 parent dc76b51 commit f02663c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions recipes/modern-cpp-kafka/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from conan.tools.layout import basic_layout
from conan.tools.files import get
from conan.tools.files import copy
from conans.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.43.0"
Expand All @@ -20,15 +21,19 @@ class ModernCppKafkaConan(ConanFile):
def requirements(self):
self.requires("librdkafka/1.8.2")

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, 17)

def layout(self):
self.folders.source = "include"

def package(self):
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"), keep_path=False)
copy(self, "*.h", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include"), keep_path=False)
copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include"), keep_path=False)

def package_id(self):
self.info.clear()
self.info.header_only()

def package_info(self):
self.cpp_info.set_property("cmake_target_name", "ModernCppKafka::ModernCppKafka")
Expand Down

0 comments on commit f02663c

Please sign in to comment.