Skip to content

Commit

Permalink
make static-library on msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
toge committed Nov 19, 2024
1 parent 87d4932 commit b6aaae2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion recipes/fpng/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 7 additions & 9 deletions recipes/fpng/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -28,24 +28,22 @@ 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

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)
Expand Down

0 comments on commit b6aaae2

Please sign in to comment.