From b6aaae27756c1d0aa6684c89a66a80afb74f10f5 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 20 Nov 2024 03:49:32 +0900 Subject: [PATCH] make static-library on msvc --- recipes/fpng/all/CMakeLists.txt | 1 - recipes/fpng/all/conanfile.py | 16 +++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/recipes/fpng/all/CMakeLists.txt b/recipes/fpng/all/CMakeLists.txt index f513bfbd7ab66..eac0e6c7dfb7b 100644 --- a/recipes/fpng/all/CMakeLists.txt +++ b/recipes/fpng/all/CMakeLists.txt @@ -6,7 +6,6 @@ include(GNUInstallDirs) add_library(fpng ${FPNG_SRC_DIR}/src/fpng.cpp) set_target_properties(fpng PROPERTIES PUBLIC_HEADER ${FPNG_SRC_DIR}/src/fpng.h - WINDOWS_EXPORT_ALL_SYMBOLS ON ) target_compile_features(fpng PRIVATE cxx_std_11) if(FPNG_WITH_SSE) diff --git a/recipes/fpng/all/conanfile.py b/recipes/fpng/all/conanfile.py index 571c3d1f0cca5..bf2a919aeebcd 100644 --- a/recipes/fpng/all/conanfile.py +++ b/recipes/fpng/all/conanfile.py @@ -2,15 +2,15 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import get, save, load from conan.tools.build import check_min_cppstd +from conan.tools.microsoft import is_msvc import os -required_conan_version = ">=1.53.0" - +required_conan_version = ">=2.1" class FpngConan(ConanFile): name = "fpng" description = "Super fast C++ .PNG writer/reader" - license = "Unlicense", + license = "Unlicense" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/richgel999/fpng" topics = ("png", "writer", "reader") @@ -28,10 +28,6 @@ class FpngConan(ConanFile): } exports_sources = ["CMakeLists.txt"] - @property - def _min_cppstd(self): - return 11 - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -39,13 +35,15 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if is_msvc(self): + self.package_type = "static-library" + del self.options.shared def layout(self): cmake_layout(self, src_folder="src") def validate(self): - if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._min_cppstd) + check_min_cppstd(self, 11) def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True)