Skip to content

Commit

Permalink
Try onetbb/2020.3 to fix link issue on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanDugueperoux2 committed Oct 5, 2024
1 parent 181d728 commit c32fa22
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions recipes/openusd/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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")
Expand All @@ -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"
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit c32fa22

Please sign in to comment.