Sfoglia il codice sorgente

Auto-update usd to v25.08 (#7922)

* Update usd to v25.08

* add check

* Fix condition check for clang toolchain support

* Add MaterialX support configuration

---------

Co-authored-by: star9029 <[email protected]>
ruki 3 settimane fa
parent
commit
57b0c4c09f
1 ha cambiato i file con 25 aggiunte e 6 eliminazioni
  1. 25 6
      packages/u/usd/xmake.lua

+ 25 - 6
packages/u/usd/xmake.lua

@@ -6,6 +6,7 @@ package("usd")
     add_urls("https://github.com/PixarAnimationStudios/USD/archive/refs/tags/$(version).tar.gz",
              "https://github.com/PixarAnimationStudios/USD.git")
 
+    add_versions("v25.08", "2a93c2390ae35a3e312f3fb66e6f403a0e046893e3f0d706be82963345a08cb3")
     add_versions("v25.05.01", "f424e8db26e063a1b005423ee52142e75c38185bbd4b8126ef64173e906dd50f")
     add_versions("v25.05", "231faca9ab71fa63d6c1e0da18bda0c365f82d9bef1cfd4b3d3d6784c8d5fb96")
     add_versions("v24.08", "6640bb184bf602c6df14fa4a83af6ac5ae1ab8d1d38cf7bb7decfaa9a7ad5d06")
@@ -14,15 +15,13 @@ package("usd")
     add_versions("v23.02", "a8eefff722db0964ce5b11b90bcdc957f3569f1cf1d44c46026ecd229ce7535d")
     add_versions("v22.11", "f34826475bb9385a9e94e2fe272cc713f517b987cbea15ee6bbc6b21db19aaae")
 
-    if is_plat("windows") then
-        add_configs("debug", {description = "Enable debug symbols.", default = false, type = "boolean", readonly = true})
-    end
     add_configs("shared", {description = "Build shared binaries.", default = true, type = "boolean", readonly = true})
     add_configs("monolithic", {description = "Build single shared library", default = false, type = "boolean"})
 
     add_configs("image", {description = "Build imaging components", default = false, type = "boolean"})
     add_configs("openimageio", {description = "Build OpenImageIO plugin", default = false, type = "boolean"})
     add_configs("opencolorio", {description = "Build OpenColorIO plugin", default = false, type = "boolean"})
+    add_configs("materialx", {description = "Enable MaterialX support", default = false, type = "boolean"})
 
     add_configs("vulkan", {description = "Enable Vulkan based components", default = false, type = "boolean"})
     add_configs("python", {description = "Enable Python based components for USD", default = false, type = "boolean"})
@@ -35,6 +34,17 @@ package("usd")
         add_defines("NOMINMAX")
     end
 
+    if on_check then
+        on_check(function (package)
+            assert(package:is_arch("x64", "x86_64"), "package(usd) only support x86")
+            if package:version() and package:version():eq("25.08") and
+                package:is_plat("linux") and package:has_tool("cxx", "clang") then
+
+                raise("package(usd v25.08) unsupported clang toolchain")
+            end
+        end)
+    end
+
     on_load(function (package)
         if package:version() and package:version():ge("v25.05") then
             package:add("deps", "tbb")
@@ -57,6 +67,10 @@ package("usd")
         if package:config("opencolorio") then
             package:add("deps", "opencolorio")
         end
+        if package:config("materialx") then
+            package:add("deps", "materialx")
+        end
+
         if package:config("python") then
             package:add("deps", "python >=3.9")
             package:addenv("PYTHONPATH", "lib/python")
@@ -67,9 +81,12 @@ package("usd")
         if package:config("tools") then
             package:addenv("PATH", "bin")
         end
+        package:addenv("PATH", "lib")
+        package:mark_as_pathenv("PXR_PLUGINPATH_NAME")
+        package:addenv("PXR_PLUGINPATH_NAME", "lib/usd")
     end)
 
-    on_install("linux", "macosx|x86_64", "windows|x64", function (package)
+    on_install("linux", "macosx", "windows", function (package)
         local configs = {
             "-DPXR_BUILD_TESTS=OFF",
             "-DPXR_BUILD_EXAMPLES=OFF",
@@ -83,11 +100,15 @@ package("usd")
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         table.insert(configs, "-DPXR_BUILD_MONOLITHIC=" .. (package:config("monolithic") and "ON" or "OFF"))
+        if package:is_plat("windows") then
+            table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=")
+        end
 
         table.insert(configs, "-DPXR_BUILD_IMAGING=" .. (package:config("image") and "ON" or "OFF"))
         table.insert(configs, "-DPXR_BUILD_USD_IMAGING=" .. (package:config("image") and "ON" or "OFF"))
         table.insert(configs, "-DPXR_BUILD_OPENIMAGEIO_PLUGIN=" .. (package:config("openimageio") and "ON" or "OFF"))
         table.insert(configs, "-DPXR_BUILD_OPENCOLORIO_PLUGIN=" .. (package:config("opencolorio") and "ON" or "OFF"))
+        table.insert(configs, "-DPXR_ENABLE_MATERIALX_SUPPORT=" .. (package:config("materialx") and "ON" or "OFF"))
 
         table.insert(configs, "-DPXR_ENABLE_VULKAN_SUPPORT=" .. (package:config("vulkan") and "ON" or "OFF"))
         table.insert(configs, "-DPXR_ENABLE_PYTHON_SUPPORT=" .. (package:config("python") and "ON" or "OFF"))
@@ -99,8 +120,6 @@ package("usd")
             opt.cxflags = "-D__TBB_NO_IMPLICIT_LINKAGE"
         end
         import("package.tools.cmake").install(package, configs, opt)
-        -- If use mv, we need to fix `xxx.cmake` file
-        os.cp(package:installdir("lib/*.dll"), package:installdir("bin"))
     end)
 
     on_test(function (package)