diff --git a/recipes/shaderc/all/test_package/conanfile.py b/recipes/shaderc/all/test_package/conanfile.py index 8cd3c70a0be631..dbf5441b0129f2 100644 --- a/recipes/shaderc/all/test_package/conanfile.py +++ b/recipes/shaderc/all/test_package/conanfile.py @@ -6,7 +6,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" def requirements(self): @@ -17,9 +17,7 @@ def layout(self): def build(self): tc = CMakeToolchain(self) - tc.variables["SHADERC_WITH_SPVC"] = ( - self.options["shaderc"].spvc if "spvc" in self.options["shaderc"] else False - ) + tc.variables["SHADERC_WITH_SPVC"] = self.dependencies["shaderc"].options.get_safe("spvc", False) cmake.configure() cmake.build() @@ -35,7 +33,7 @@ def test(self): spv_name = "test_package.spv" self.run(f'glslc "{in_glsl_name}" -o {spv_name}', env="conanrun") - if "spvc" in self.options["shaderc"] and self.options["shaderc"].spvc: + if "spvc" in self.options["shaderc"] and self.dependencies["shaderc"].options.spvc: # Test programs consuming shaderc_spvc lib bin_path_spvc_c = os.path.join(self.cpp.build.bindir, "test_package_spvc_c") self.run(bin_path_spvc_c, env="conanrun")