Skip to content

Commit

Permalink
Added version 1.3.0
Browse files Browse the repository at this point in the history
*  attempt to handle submodules (dependencies didn't work properly)
* handling options
* MT builds are no longer supported
  • Loading branch information
psyinf committed Mar 15, 2023
1 parent 1f2d199 commit c4d7c8d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions recipes/vsg/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ sources:
"1.0.0":
url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-1.0.0.tar.gz"
sha256: "5611284f4256893ea97a33f9e99f5ecc8bdda110cc9fb7770b291fb45e8f9cf6"
"1.0.3":
url: "https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-1.0.3.tar.gz"
sha256: "84aa1d445ecdd2702843f8f01e760d4db32c2ab3fe8c5d6122f8a83b67a50e36"
24 changes: 22 additions & 2 deletions recipes/vsg/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ class VsgConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"shader_compiler": [True, False],
"max_devices": [1,2,3,4],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"shader_compiler": True,
"max_devices" : 1,
"fPIC": True,

}

@property
Expand All @@ -46,7 +51,7 @@ def config_options(self):
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")

Expand All @@ -58,6 +63,10 @@ def validate(self):
if self.info.settings.compiler.cppstd:
check_min_cppstd(self, self._min_cppstd)
check_min_vs(self, 191)

if is_msvc(self) and self.settings.compiler.runtime in ["MTd", "MT"]:
raise ConanInvalidConfiguration(f"{self.name} does not support MSVC MT/MTd configurations, only MD/MDd is supported")

if not is_msvc(self):
minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False)
if minimum_version and Version(self.info.settings.compiler.version) < minimum_version:
Expand All @@ -67,12 +76,23 @@ def validate(self):

def source(self):
get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True)

#Working around submodules
#TODO: semantic versioning
if self.version == "1.0.3":
self.run("git clone https://github.com/vsg-dev/glslang.git src/glslang")
self.run("cd src/glslang && git reset --hard e4075496f6895ce6b747a6690ba13fa3836a93e5")



def generate(self):
tc = CMakeToolchain(self)
#???
if is_msvc(self):
tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self)
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
tc.variables["VSG_SUPPORTS_ShaderCompiler"] = 1 if self.options.shader_compiler else 0
tc.variables["VSG_MAX_DEVICES"] = self.options.max_devices

tc.generate()
tc = CMakeDeps(self)
tc.generate()
Expand Down

0 comments on commit c4d7c8d

Please sign in to comment.