From e501d05ac6b518d7e7ae5039d0450c0ab265f43d Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Tue, 30 Apr 2024 15:11:34 +0200 Subject: [PATCH 01/11] WIP --- recipes/yomm2/all/conandata.yml | 4 + recipes/yomm2/all/conanfile.py | 98 +++++++++++++++++++ recipes/yomm2/all/test_package/CMakeLists.txt | 8 ++ recipes/yomm2/all/test_package/conanfile.py | 26 +++++ .../yomm2/all/test_package/test_package.cpp | 50 ++++++++++ recipes/yomm2/config.yml | 3 + 6 files changed, 189 insertions(+) create mode 100644 recipes/yomm2/all/conandata.yml create mode 100644 recipes/yomm2/all/conanfile.py create mode 100644 recipes/yomm2/all/test_package/CMakeLists.txt create mode 100644 recipes/yomm2/all/test_package/conanfile.py create mode 100644 recipes/yomm2/all/test_package/test_package.cpp create mode 100644 recipes/yomm2/config.yml diff --git a/recipes/yomm2/all/conandata.yml b/recipes/yomm2/all/conandata.yml new file mode 100644 index 0000000000000..942307e52eb8a --- /dev/null +++ b/recipes/yomm2/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.5.1": + url: "https://github.com/jll63/yomm2/archive/refs/tags/v1.5.1.tar.gz" + sha256: "59902bea55585d870fd7681eabe6091fbfd1a8776d1950f859d2dbbd510c74bd" diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py new file mode 100644 index 0000000000000..662e7583817b8 --- /dev/null +++ b/recipes/yomm2/all/conanfile.py @@ -0,0 +1,98 @@ +import os + +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +from conan.tools.files import get, rm, rmdir, copy +from conan.tools.scm import Version +from conans.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.53.0" + + +class yomm2Recipe(ConanFile): + name = "yomm2" + package_type = "library" + # Optional metadata + license = "BSL-1.0" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/jll63/yomm2" + description = "Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17" + topics = ("multi-methods", "library", "expressions", "c++17") + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = { + "shared": [True, False], + "fPIC": [True, False] + } + default_options = { + "shared": False, "fPIC": True + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "9", + "clang": "5", + "apple-clang": "10", + "msvc": "193", + } + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.20 <4]") + + def requirements(self): + self.requires("boost/1.74.0") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def layout(self): + cmake_layout(self, src_folder="src") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.variables["YOMM2_ENABLE_EXAMPLES"] = "OFF" + tc.variables["YOMM2_ENABLE_TESTS"] = "OFF" + tc.variables["YOMM2_SHARED"] = self.options.shared + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "YOMM2") + self.cpp_info.set_property("cmake_target_name", "YOMM2::yomm2") + self.cpp_info.libs = ["yomm2"] diff --git a/recipes/yomm2/all/test_package/CMakeLists.txt b/recipes/yomm2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..b7be49474f6cc --- /dev/null +++ b/recipes/yomm2/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) + +find_package(YOMM2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE YOMM2::yomm2) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/yomm2/all/test_package/conanfile.py b/recipes/yomm2/all/test_package/conanfile.py new file mode 100644 index 0000000000000..189c09687bde3 --- /dev/null +++ b/recipes/yomm2/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class yomm2TestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/yomm2/all/test_package/test_package.cpp b/recipes/yomm2/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7a5a0d9202062 --- /dev/null +++ b/recipes/yomm2/all/test_package/test_package.cpp @@ -0,0 +1,50 @@ +// Copyright (c) 2018-2021 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +using std::string; + +#include + +using yorel::yomm2::virtual_; + +struct A { + virtual ~A() { + } +}; +struct B : A {}; +struct C : A {}; +struct D : B, C {}; + +register_class(A); +register_class(B, A); +register_class(C, A); +register_class(D, B, C); + +declare_method(string, foobar, (virtual_)); + +define_method(string, foobar, (A&)) { + return "foobar(A)"; +} + +define_method(string, foobar, (C&)) { + return "foobar(C)"; +} + +#include +#include + +int main() { + yorel::yomm2::update(); + + D d; + B& db = d; // B part of D + C& dc = d; // C part of D + std::cout << foobar(db) << "\n"; + std::cout << foobar(dc) << "\n"; + //std::cout << foobar(d) << "\n"; +} diff --git a/recipes/yomm2/config.yml b/recipes/yomm2/config.yml new file mode 100644 index 0000000000000..f1c5e3d313178 --- /dev/null +++ b/recipes/yomm2/config.yml @@ -0,0 +1,3 @@ +versions: + "1.5.1": + folder: all From fba35db108d58bbd0ab987dcfbcd5df7bf3b04bc Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Wed, 8 May 2024 12:52:36 +0200 Subject: [PATCH 02/11] Fixed static vs shared mode --- recipes/yomm2/all/conandata.yml | 2 +- recipes/yomm2/all/conanfile.py | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/recipes/yomm2/all/conandata.yml b/recipes/yomm2/all/conandata.yml index 942307e52eb8a..bb998ec99294f 100644 --- a/recipes/yomm2/all/conandata.yml +++ b/recipes/yomm2/all/conandata.yml @@ -1,4 +1,4 @@ sources: "1.5.1": url: "https://github.com/jll63/yomm2/archive/refs/tags/v1.5.1.tar.gz" - sha256: "59902bea55585d870fd7681eabe6091fbfd1a8776d1950f859d2dbbd510c74bd" + sha256: "323abba27a356555cc3ead3e3e950746ab43f90d97ad21950f2ba3afaf565ecc" diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index 662e7583817b8..2d2297e310fc0 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -12,13 +12,13 @@ class yomm2Recipe(ConanFile): name = "yomm2" - package_type = "library" + package_type = "library" # if static, it's a header-only one # Optional metadata license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jll63/yomm2" description = "Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17" - topics = ("multi-methods", "library", "expressions", "c++17") + topics = ("multi-methods", "library", "header-only", "expressions", "c++17") # Binary configuration settings = "os", "compiler", "build_type", "arch" options = { @@ -26,7 +26,8 @@ class yomm2Recipe(ConanFile): "fPIC": [True, False] } default_options = { - "shared": False, "fPIC": True + "shared": False, + "fPIC": True } @property @@ -36,10 +37,10 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "gcc": "9", + "gcc": "8", "clang": "5", - "apple-clang": "10", - "msvc": "193", + "apple-clang": "12", + "msvc": "192" } def config_options(self): @@ -63,7 +64,10 @@ def build_requirements(self): self.tool_requires("cmake/[>=3.20 <4]") def requirements(self): - self.requires("boost/1.74.0") + # Upstream requires Boost 1.74 + # Using more modern Boost version to avoid issues like the one commented here: + # - https://github.com/conan-io/conan/issues/15977#issuecomment-2098003085 + self.requires("boost/1.85.0", transitive_headers=True) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) @@ -90,9 +94,16 @@ def package(self): cmake = CMake(self) cmake.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + if self.options.shared: + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: # header-only one + rmdir(self, os.path.join(self.package_folder, "lib")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "YOMM2") self.cpp_info.set_property("cmake_target_name", "YOMM2::yomm2") - self.cpp_info.libs = ["yomm2"] + if self.options.shared: + self.cpp_info.libs = ["yomm2"] + else: # header-only one + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] From 86606e59a6eb8ec30964f632a360e7979255fd54 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Wed, 8 May 2024 12:58:50 +0200 Subject: [PATCH 03/11] legacy import --- recipes/yomm2/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index 2d2297e310fc0..ca32bcb74c112 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -1,11 +1,11 @@ import os from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps from conan.tools.files import get, rm, rmdir, copy from conan.tools.scm import Version -from conans.errors import ConanInvalidConfiguration required_conan_version = ">=1.53.0" From 7b8cab7ce26ccf3aaf2c4b8cb15eb4bbbba31d3d Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Wed, 8 May 2024 14:38:41 +0200 Subject: [PATCH 04/11] updated topics --- recipes/yomm2/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index ca32bcb74c112..63e6276b5d9e8 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -18,7 +18,8 @@ class yomm2Recipe(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jll63/yomm2" description = "Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17" - topics = ("multi-methods", "library", "header-only", "expressions", "c++17") + topics = ("multi-methods", "multiple-dispatch", "open-methods", "library", + "header-only", "polymorphism", "expression-problem", "c++17") # Binary configuration settings = "os", "compiler", "build_type", "arch" options = { From c58c5780685bb4823529245e1625edcba213ebcc Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Thu, 9 May 2024 10:42:23 +0200 Subject: [PATCH 05/11] Adding info.clear if static --- recipes/yomm2/all/conanfile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index 63e6276b5d9e8..3108dfb9feb96 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -90,6 +90,11 @@ def build(self): cmake.configure() cmake.build() + def package_id(self): + # if yomm2 is built as static, it behaves as a header-only one + if not self.info.options.shared: + self.info.clear() + def package(self): copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) @@ -105,6 +110,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "YOMM2::yomm2") if self.options.shared: self.cpp_info.libs = ["yomm2"] - else: # header-only one + else: # static == header-only self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] From 3e4f794d9338543b83f80ee92b2eaa3c2e2a535e Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Thu, 9 May 2024 12:04:29 +0200 Subject: [PATCH 06/11] Simplifying things with header-only option --- recipes/yomm2/all/conanfile.py | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index 3108dfb9feb96..be6a87adfbee2 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -12,23 +12,21 @@ class yomm2Recipe(ConanFile): name = "yomm2" - package_type = "library" # if static, it's a header-only one + package_type = "shared-library" # Optional metadata license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/jll63/yomm2" description = "Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17" - topics = ("multi-methods", "multiple-dispatch", "open-methods", "library", + topics = ("multi-methods", "multiple-dispatch", "open-methods", "shared-library", "header-only", "polymorphism", "expression-problem", "c++17") # Binary configuration settings = "os", "compiler", "build_type", "arch" options = { - "shared": [True, False], - "fPIC": [True, False] + "header_only": [True, False], } default_options = { - "shared": False, - "fPIC": True + "header_only": False } @property @@ -44,13 +42,9 @@ def _compilers_minimum_version(self): "msvc": "192" } - def config_options(self): - if self.settings.os == "Windows": - self.options.rm_safe("fPIC") - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") + if self.options.header_only: + self.package_type = "header-library" def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -82,7 +76,7 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["YOMM2_ENABLE_EXAMPLES"] = "OFF" tc.variables["YOMM2_ENABLE_TESTS"] = "OFF" - tc.variables["YOMM2_SHARED"] = self.options.shared + tc.variables["YOMM2_SHARED"] = not bool(self.options.header_only) tc.generate() def build(self): @@ -92,7 +86,7 @@ def build(self): def package_id(self): # if yomm2 is built as static, it behaves as a header-only one - if not self.info.options.shared: + if self.info.options.header_only: self.info.clear() def package(self): @@ -100,16 +94,16 @@ def package(self): cmake = CMake(self) cmake.install() rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - if self.options.shared: - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - else: # header-only one + if self.options.header_only: rmdir(self, os.path.join(self.package_folder, "lib")) + else: + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "YOMM2") self.cpp_info.set_property("cmake_target_name", "YOMM2::yomm2") - if self.options.shared: - self.cpp_info.libs = ["yomm2"] - else: # static == header-only + if self.options.header_only: self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] + else: + self.cpp_info.libs = ["yomm2"] From aa3f7f88a3d7f75ab4097388187d4c20a0bc300d Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Thu, 9 May 2024 14:50:58 +0200 Subject: [PATCH 07/11] Simplified test --- recipes/yomm2/all/test_package/CMakeLists.txt | 2 +- .../yomm2/all/test_package/test_package.cpp | 45 +++++-------------- 2 files changed, 11 insertions(+), 36 deletions(-) diff --git a/recipes/yomm2/all/test_package/CMakeLists.txt b/recipes/yomm2/all/test_package/CMakeLists.txt index b7be49474f6cc..2686aaf2077a9 100644 --- a/recipes/yomm2/all/test_package/CMakeLists.txt +++ b/recipes/yomm2/all/test_package/CMakeLists.txt @@ -4,5 +4,5 @@ project(test_package LANGUAGES CXX) find_package(YOMM2 REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE YOMM2::yomm2) +target_link_libraries(${PROJECT_NAME} PRIVATE YOMM2::yomm2 ${CMAKE_THREAD_LIBS_INIT}) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/yomm2/all/test_package/test_package.cpp b/recipes/yomm2/all/test_package/test_package.cpp index 7a5a0d9202062..dd17d7408403d 100644 --- a/recipes/yomm2/all/test_package/test_package.cpp +++ b/recipes/yomm2/all/test_package/test_package.cpp @@ -1,50 +1,25 @@ -// Copyright (c) 2018-2021 Jean-Louis Leroy +// Copyright (c) 2021 Jean-Louis Leroy // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) +#include + #include +#include #include -using std::string; - -#include - +using std::cout; using yorel::yomm2::virtual_; -struct A { - virtual ~A() { - } -}; -struct B : A {}; -struct C : A {}; -struct D : B, C {}; - -register_class(A); -register_class(B, A); -register_class(C, A); -register_class(D, B, C); +// register_class(classes); -declare_method(string, foobar, (virtual_)); +// declare_method(return, name, (params)); -define_method(string, foobar, (A&)) { - return "foobar(A)"; -} - -define_method(string, foobar, (C&)) { - return "foobar(C)"; -} - -#include -#include +// define_method(return, name, (params)) { +// } int main() { yorel::yomm2::update(); - - D d; - B& db = d; // B part of D - C& dc = d; // C part of D - std::cout << foobar(db) << "\n"; - std::cout << foobar(dc) << "\n"; - //std::cout << foobar(d) << "\n"; + return 0; } From 1f5c0b8b57a42617eb5c7ab40f030297e9f9610b Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Thu, 9 May 2024 15:45:33 +0200 Subject: [PATCH 08/11] Fixed conan minimum version --- recipes/yomm2/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index be6a87adfbee2..bb7e13ae5361b 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -7,7 +7,7 @@ from conan.tools.files import get, rm, rmdir, copy from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class yomm2Recipe(ConanFile): From 22b1b413dfd2623d0c620e358831e1356dcf28e7 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Thu, 9 May 2024 17:15:19 +0200 Subject: [PATCH 09/11] Avoiding extra-compilation steps (docs.in) --- recipes/yomm2/all/conanfile.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index bb7e13ae5361b..077219f53c747 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -4,7 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps -from conan.tools.files import get, rm, rmdir, copy +from conan.tools.files import get, rm, rmdir, copy, replace_in_file from conan.tools.scm import Version required_conan_version = ">=1.54.0" @@ -79,7 +79,12 @@ def generate(self): tc.variables["YOMM2_SHARED"] = not bool(self.options.header_only) tc.generate() + def _patch_sources(self): + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file(self, cmakelists, "add_subdirectory(docs.in)", "") + def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -105,5 +110,7 @@ def package_info(self): if self.options.header_only: self.cpp_info.bindirs = [] self.cpp_info.libdirs = [] - else: + else: # shared-library self.cpp_info.libs = ["yomm2"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") From b55f73477e58cbb99f2f9205d1be69f0ff82ed91 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Mon, 13 May 2024 09:25:54 +0200 Subject: [PATCH 10/11] Default as header-only --- recipes/yomm2/all/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index 077219f53c747..48810a9bcf9ef 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -12,7 +12,7 @@ class yomm2Recipe(ConanFile): name = "yomm2" - package_type = "shared-library" + package_type = "header-library" # Optional metadata license = "BSL-1.0" url = "https://github.com/conan-io/conan-center-index" @@ -26,7 +26,7 @@ class yomm2Recipe(ConanFile): "header_only": [True, False], } default_options = { - "header_only": False + "header_only": True } @property @@ -43,8 +43,8 @@ def _compilers_minimum_version(self): } def configure(self): - if self.options.header_only: - self.package_type = "header-library" + if not bool(self.options.header_only): + self.package_type = "shared-library" def validate(self): if self.settings.compiler.get_safe("cppstd"): From 7970be3d6d80008389bc19c06baa4d24d34c2309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ram=C3=ADrez?= Date: Mon, 13 May 2024 11:17:46 +0200 Subject: [PATCH 11/11] Update recipes/yomm2/all/conanfile.py --- recipes/yomm2/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/yomm2/all/conanfile.py b/recipes/yomm2/all/conanfile.py index 48810a9bcf9ef..770cbf94dd1df 100644 --- a/recipes/yomm2/all/conanfile.py +++ b/recipes/yomm2/all/conanfile.py @@ -112,5 +112,5 @@ def package_info(self): self.cpp_info.libdirs = [] else: # shared-library self.cpp_info.libs = ["yomm2"] - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("m") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m")