Skip to content

Commit

Permalink
Merge pull request conan-io#2264 from SpaceIm/bump/spirv-cross/20200629
Browse files Browse the repository at this point in the history
add spirv cross/20200629
  • Loading branch information
danimtb committed Jul 29, 2020
2 parents 14e9846 + e7650a0 commit 1360d6d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
3 changes: 3 additions & 0 deletions recipes/spirv-cross/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"20200629":
url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-06-29.tar.gz"
sha256: "29523168867fcfa55b03a65970a8572be67e37accb08ce1051b2d3ae19011452"
"20200519":
url: "https://github.com/KhronosGroup/SPIRV-Cross/archive/2020-05-19.tar.gz"
sha256: "6cf18ee3fe1a8d64a20da3c5fac334da4c4762d29d7e55a2f0b555cbf5cff708"
Expand Down
25 changes: 9 additions & 16 deletions recipes/spirv-cross/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ def config_options(self):
del self.options.fPIC

def configure(self):
if not self.options.glsl and \
(self.options.hlsl or self.options.msl or self.options.cpp or self.options.reflect):
raise ConanInvalidConfiguration("hlsl, msl, cpp and reflect require glsl enabled")
if self.options.shared:
del self.options.fPIC
# these options don't contribute to shared binary
del self.options.c_api
del self.options.util
if not self.options.glsl and \
(self.options.hlsl or self.options.msl or self.options.cpp or self.options.reflect):
raise ConanInvalidConfiguration("hlsl, msl, cpp and reflect require glsl enabled")

def source(self):
tools.get(**self.conan_data["sources"][self.version])
Expand Down Expand Up @@ -141,10 +142,12 @@ def package_info(self):
self.cpp_info.includedirs.append(os.path.join("include", "spirv_cross"))
if self.settings.os == "Linux" and self.options.glsl:
self.cpp_info.system_libs.append("m")
if not self.options.shared and self.options.c_api and self._stdcpp_library:
self.cpp_info.system_libs.append(self._stdcpp_library)
if not self.options.shared and self.options.c_api and tools.stdcpp_library(self):
self.cpp_info.system_libs.append(tools.stdcpp_library(self))
if self.options.build_executable:
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bin_path))
self.env_info.PATH.append(bin_path)

def _get_ordered_libs(self):
libs = []
Expand Down Expand Up @@ -175,13 +178,3 @@ def _get_ordered_libs(self):
if self.settings.os == "Windows" and self.settings.build_type == "Debug":
libs = [lib + "d" for lib in libs]
return libs

@property
def _stdcpp_library(self):
libcxx = self.settings.get_safe("compiler.libcxx")
if libcxx in ("libstdc++", "libstdc++11"):
return "stdc++"
elif libcxx in ("libc++",):
return "c++"
else:
return False
2 changes: 2 additions & 0 deletions recipes/spirv-cross/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"20200629":
folder: all
"20200519":
folder: all
"20200403":
Expand Down

0 comments on commit 1360d6d

Please sign in to comment.