(#12296) glew: generate gcc11 binaries

* glew: generate gcc11 binaries

* Update conanfile.py

* Update conanfile.py

* Update conanfile.py
This commit is contained in:
ericLemanissier
2022-08-24 09:46:22 +02:00
committed by GitHub
parent 4634b80b76
commit 5b365d31dd

View File

@@ -1,6 +1,7 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools import files
from conans import CMake
import functools
import os
required_conan_version = ">=1.43.0"
@@ -56,7 +57,7 @@ class GlewConan(ConanFile):
self.requires("glu/system")
def source(self):
tools.get(**self.conan_data["sources"][self.version],
files.get(self, **self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)
@functools.lru_cache(1)
@@ -68,8 +69,7 @@ class GlewConan(ConanFile):
return cmake
def build(self):
for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)
files.apply_conandata_patches(self)
cmake = self._configure_cmake()
cmake.build()
@@ -77,9 +77,9 @@ class GlewConan(ConanFile):
self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder)
cmake = self._configure_cmake()
cmake.install()
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
tools.remove_files_by_mask(os.path.join(self.package_folder, "lib"), "*.pdb")
files.rmdir(self, f"{self.package_folder}/lib/pkgconfig")
files.rmdir(self, f"{self.package_folder}/lib/cmake")
files.rm(self, "*.pdb", f"{self.package_folder}/lib")
def package_info(self):
glewlib_target_name = "glew" if self.options.shared else "glew_s"
@@ -89,10 +89,16 @@ class GlewConan(ConanFile):
self.cpp_info.set_property("cmake_target_name", "GLEW::GLEW")
self.cpp_info.set_property("pkg_config_name", "glew")
self.cpp_info.components["glewlib"].set_property("cmake_module_target_name", "GLEW::GLEW")
self.cpp_info.components["glewlib"].set_property("cmake_target_name", "GLEW::{}".format(glewlib_target_name))
self.cpp_info.components["glewlib"].set_property("cmake_target_name", f"GLEW::{glewlib_target_name}")
self.cpp_info.components["glewlib"].set_property("pkg_config_name", "glew")
self.cpp_info.components["glewlib"].libs = tools.collect_libs(self)
if self.settings.os == "Windows":
lib_name = "glew32" if self.options.shared else "libglew32"
else:
lib_name = "GLEW"
if self.settings.build_type == "Debug":
lib_name += "d"
self.cpp_info.components["glewlib"].libs = [lib_name]
if self.settings.os == "Windows" and not self.options.shared:
self.cpp_info.components["glewlib"].defines.append("GLEW_STATIC")
self.cpp_info.components["glewlib"].requires = ["opengl::opengl", "glu::glu"]