Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(AGENT_VERSION_MAJOR 2)
set(AGENT_VERSION_MINOR 6)
set(AGENT_VERSION_PATCH 0)
set(AGENT_VERSION_BUILD 0)
set(AGENT_VERSION_BUILD 1)
set(AGENT_VERSION_RC "")

# This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent
Expand Down
25 changes: 0 additions & 25 deletions conan/cmake/conandata.yml

This file was deleted.

166 changes: 0 additions & 166 deletions conan/cmake/conanfile.py

This file was deleted.

24 changes: 0 additions & 24 deletions conan/cmake/test_package/conanfile.py

This file was deleted.

23 changes: 0 additions & 23 deletions conan/cmake/test_v1_package/conanfile.py

This file was deleted.

2 changes: 1 addition & 1 deletion conan/mruby/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MRubyConan(ConanFile):

options = { "shared": [True, False], "trace": [True, False] }

requires = ["oniguruma/6.9.8"]
requires = ["oniguruma/6.9.10"]

default_options = {
"shared": False,
Expand Down
90 changes: 90 additions & 0 deletions conan/oniguruma/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import copy, get, rm, rmdir
from conan.tools.scm import Version
import os

required_conan_version = ">=1.54.0"


class OnigurumaConan(ConanFile):
name = "oniguruma"
description = "Oniguruma is a modern and flexible regular expressions library."
license = "BSD-2-Clause"
topics = ("oniguruma", "regex")
homepage = "https://github.com/kkos/oniguruma"
url = "https://github.com/conan-io/conan-center-index"
version = "6.9.10"

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
"posix_api": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"posix_api": True,
}

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
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")

def source(self):
get(self, "https://github.com/kkos/oniguruma/releases/download/v6.9.10/onig-6.9.10.tar.gz", strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
tc.variables["ENABLE_POSIX_API"] = self.options.posix_api
tc.variables["ENABLE_BINARY_COMPATIBLE_POSIX_API"] = self.options.posix_api
if Version(self.version) >= "6.9.8":
tc.variables["INSTALL_DOCUMENTATION"] = False
tc.variables["INSTALL_EXAMPLES"] = False
tc.generate()

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
cmake.install()
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
if Version(self.version) < "6.9.8":
rmdir(self, os.path.join(self.package_folder, "share"))
else:
if self.settings.os == "Windows" and self.options.shared:
rm(self, "onig-config", os.path.join(self.package_folder, "bin"))
else:
rmdir(self, os.path.join(self.package_folder, "bin"))

def package_info(self):
self.cpp_info.set_property("cmake_file_name", "oniguruma")
self.cpp_info.set_property("cmake_target_name", "oniguruma::onig")
self.cpp_info.set_property("pkg_config_name", "oniguruma")
# TODO: back to global scope after conan v2 once cmake_find_package_* removed
self.cpp_info.components["onig"].libs = ["onig"]
if not self.options.shared:
self.cpp_info.components["onig"].defines.append("ONIG_STATIC")

# TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed
self.cpp_info.components["onig"].set_property("cmake_target_name", "oniguruma::onig")
self.cpp_info.components["onig"].set_property("pkg_config_name", "oniguruma")
self.cpp_info.components["onig"].names["cmake_find_package"] = "onig"
self.cpp_info.components["onig"].names["cmake_find_package_multi"] = "onig"
self.cpp_info.components["onig"].names["pkg_config"] = "oniguruma"
5 changes: 4 additions & 1 deletion conan/profiles/macos
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ compiler=apple-clang
compiler.cppstd=gnu17

[system_tools]
cmake/>3.26.0
cmake/>3.26.0



5 changes: 3 additions & 2 deletions conan/profiles/xcode
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ include(default)
[settings]
compiler.cppstd=17

[system_tools]
cmake/>3.23.0
[platform_tool_requires]
cmake/3.26.4

[conf]
tools.cmake.cmaketoolchain:generator=Xcode

Loading