Skip to content

Commit

Permalink
ocilib: apply conan pipeline reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
inPhraZ committed Jun 20, 2024
1 parent 8c125c0 commit c7bd67d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion recipes/ocilib/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get, rm, rmdir, chdir
from conan.tools.gnu import Autotools, AutotoolsDeps, AutotoolsToolchain
from conan.tools.scm import Version
Expand Down Expand Up @@ -29,7 +30,13 @@ class OCILIBConan(ConanFile):
"with_oracle_import": "runtime",
}

@property
def _min_cppstd(self):
return 11

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)
if self.settings.os != "Linux":
raise ConanInvalidConfiguration(f"{self.ref} recipe only supports Linux for now. Pull requests to add new configurtations are welcomed.")
# TODO: Check support for other platforms
Expand All @@ -56,7 +63,10 @@ def build(self):
autotools.make()

def package(self):
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
autotools = Autotools(self)
autotools.install()

copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses"))
copy(self, "*", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder, "include"))
copy(self, "*.lib", self.source_folder, os.path.join(self.package_folder, "lib"), keep_path=False)
copy(self, "*.a", self.source_folder, os.path.join(self.package_folder, "lib"), keep_path=False)
Expand All @@ -66,4 +76,5 @@ def package(self):

def package_info(self):
self.cpp_info.libs = ["ocilib"]
self.cpp_info.set_property("pkg_config_name", "ocilib")
self.cpp_info.system_libs.append("dl")
2 changes: 2 additions & 0 deletions recipes/ocilib/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)

find_package(ocilib REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
Expand Down

0 comments on commit c7bd67d

Please sign in to comment.