From a54337a96d3aa2e6b9fbfd5f71aacbd59e02f27a Mon Sep 17 00:00:00 2001 From: L-Sun Date: Wed, 21 Dec 2022 20:05:44 +0800 Subject: [PATCH] new package usd (#1684) * new package usd * fix typo * disable static build on windows * fix static build * disable static build --- packages/u/usd/xmake.lua | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 packages/u/usd/xmake.lua diff --git a/packages/u/usd/xmake.lua b/packages/u/usd/xmake.lua new file mode 100644 index 000000000..df7f24e04 --- /dev/null +++ b/packages/u/usd/xmake.lua @@ -0,0 +1,46 @@ +package("usd") + set_homepage("http://www.openusd.org") + set_description("Universal Scene Description") + + add_urls("https://github.com/PixarAnimationStudios/USD/archive/refs/tags/$(version).tar.gz", + "https://github.com/PixarAnimationStudios/USD.git") + add_versions("v22.11", "f34826475bb9385a9e94e2fe272cc713f517b987cbea15ee6bbc6b21db19aaae") + + 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_deps("cmake", "boost") + -- usd only support tbb 2022 now https://github.com/PixarAnimationStudios/USD/issues/1471 + add_deps("tbb 2020.3") + + if is_plat("windows") then + add_defines("NOMINMAX") + end + + on_install("linux", "macosx", "windows|x64", function (package) + local configs = { + "-DPXR_BUILD_ALEMBIC_PLUGIN=OFF", + "-DBoost_NO_BOOST_CMAKE=OFF", + "-DPXR_BUILD_EMBREE_PLUGIN=OFF", + "-DPXR_BUILD_IMAGING=OFF", + "-DPXR_BUILD_MONOLITHIC=OFF", + "-DPXR_BUILD_TESTS=OFF", + "-DPXR_BUILD_USD_IMAGING=OFF", + "-DPXR_ENABLE_PYTHON_SUPPORT=OFF", + "-DPXR_BUILD_EXAMPLES=OFF", + "-DPXR_BUILD_TUTORIALS=OFF", + "-DPXR_BUILD_USD_TOOLS=OFF", + "-DPXR_BUILD_MONOLITHIC=" .. (package:config("monolithic") and "ON" or "OFF") + } + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test () { + auto stage = pxr::UsdStage::CreateInMemory(); + } + ]]}, {configs = {languages = "c++17"}, includes = "pxr/usd/usd/stage.h"})) + end) \ No newline at end of file