From c32fa22d754351c493cc0aedcc3e7d4882287f2e Mon Sep 17 00:00:00 2001 From: Esteban DUGUEPEROUX Date: Fri, 4 Oct 2024 23:47:37 +0200 Subject: [PATCH] Try onetbb/2020.3 to fix link issue on MacOS --- recipes/openusd/all/conanfile.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/recipes/openusd/all/conanfile.py b/recipes/openusd/all/conanfile.py index 5fbee048d33acb..b22f6e2f20ae96 100644 --- a/recipes/openusd/all/conanfile.py +++ b/recipes/openusd/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, load, get, rm, rmdir from conan.tools.scm import Version import os @@ -117,13 +117,15 @@ def configure(self): # Set same options as in https://github.com/PixarAnimationStudios/OpenUSD/blob/release/build_scripts/build_usd.py#L1397 # self.options["opensubdiv/*"].with_tbb = True self.options["opensubdiv/*"].with_opengl = self.options.enable_gl_support and not is_apple_os(self) + # FIXME: provokes a missing binary error on conan center + self.options["opensubdiv/*"].with_metal = is_apple_os(self) def layout(self): cmake_layout(self, src_folder="src") def requirements(self): if self.options.enable_python_support: - self.requires("boost/1.84.0") + self.requires("boost/1.86.0") # openusd doesn't support yet recent release of onetbb, see https://github.com/PixarAnimationStudios/OpenUSD/issues/1471 self.requires("onetbb/2021.10.0", transitive_headers=True) @@ -171,7 +173,8 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if is_apple_os(self) and not self.dependencies["opensubdiv"].options["with_metal"]: + # if is_apple_os(self) and not self.dependencies["opensubdiv"].options["with_metal"]: + if is_apple_os(self): raise ConanInvalidConfiguration(f'{self.ref} needs -o="opensubdiv/*:with_metal=True"') if self.options.build_animx_tests: raise ConanInvalidConfiguration("animx recipe doesn't yet exists in conan center index") @@ -195,7 +198,10 @@ def generate(self): tc.variables["PXR_BUILD_USD_TOOLS"] = self.options.build_usd_tools tc.variables["OPENSUBDIV_LIBRARIES"] = self.dependencies['opensubdiv'].cpp_info.libdirs[0] - tc.variables["OPENSUBDIV_INCLUDE_DIR"] = self.dependencies['opensubdiv'].cpp_info.includedirs[0] + # Provokes cmake parsing error + # See https://c3i.jfrog.io/c3i/misc/logs/pr/24506/75-windows-visual_studio/openusd/24.08//a47d3be1b4a4ee7c129fc15ba3f28e471624adfb-build.txt + # See + # tc.variables["OPENSUBDIV_INCLUDE_DIR"] = self.dependencies['opensubdiv'].cpp_info.includedirs[0] # tc.variables["OPENSUBDIV_OSDCPU_LIBRARY"] = "OpenSubdiv::osdcpu" tc.variables["TBB_tbb_LIBRARY"] = "TBB::tbb" @@ -253,6 +259,12 @@ def generate(self): tc.generate() + self.output.info("Content of conan_toolchain.cmake") + self.output.info(str(self.build_folder)) + conan_toolchain = load(self, os.path.join(self.build_folder, "generators", "conan_toolchain.cmake")) + self.output.info(str(conan_toolchain)) + self.output.info("End of conan_toolchain.cmake") + tc = CMakeDeps(self) if self.options.enable_materialx_support: tc.set_property("materialx::MaterialXCore", "cmake_target_name", "MaterialXCore")