diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 27e7d26..7196a4d 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -22,14 +22,15 @@ jobs: fail-fast: false matrix: usd: ["v24.08", "v25.05"] - python: ["3.10", "3.12"] + python: ["", "3.10", "3.12"] - name: "USD-${{ matrix.usd }}-py${{ matrix.python }}" + name: "USD-${{ matrix.usd }}${{ matrix.python != '' && format('-py{0}', matrix.python) || '-no-py' }}" steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python }} + if: matrix.python != '' uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} @@ -38,10 +39,14 @@ jobs: run: | sudo apt update sudo apt install -y libgtest-dev ninja-build - python -m pip install -r ${{github.workspace}}/test/requirements.txt mkdir -p ${{github.workspace}}/build mkdir -p ${{runner.temp}}/USD + - name: Install test Python deps + if: matrix.python != '' + run: | + python -m pip install -r ${{github.workspace}}/test/requirements.txt + - name: Download USD working-directory: ${{runner.temp}}/USD run: | @@ -57,6 +62,7 @@ jobs: sed -i '/BOOST_URL/ s|\.zip"|.zip/download"|' src/build_scripts/build_usd.py - name: Install USD + if: matrix.python != '' working-directory: ${{runner.temp}}/USD run: | python ./src/build_scripts/build_usd.py . \ @@ -69,7 +75,23 @@ jobs: --no-materialx \ -v + - name: Install USD (without Python) + if: matrix.python == '' + working-directory: ${{runner.temp}}/USD + run: | + python ./src/build_scripts/build_usd.py . \ + --no-tests \ + --no-examples \ + --no-tutorials \ + --no-tools \ + --no-docs \ + --no-imaging \ + --no-materialx \ + --no-python \ + -v + - name: Configure & Build + if: matrix.python != '' working-directory: ${{github.workspace}}/build run: | export PYTHONPATH="${{runner.temp}}/USD/lib/python" @@ -80,6 +102,18 @@ jobs: .. cmake --build . --config Release + - name: Configure & Build (without Python) + if: matrix.python == '' + working-directory: ${{github.workspace}}/build + run: | + cmake \ + -D "BUILD_DOCS=OFF" \ + -D "BUILD_PYTHON_BINDINGS=OFF" \ + -D "CMAKE_INCLUDE_PATH=${{runner.temp}}/USD/include" \ + -D "CMAKE_LIBRARY_PATH=${{runner.temp}}/USD/lib" \ + .. + cmake --build . --config Release + - name: Check for formatting errors working-directory: ${{github.workspace}}/build run: | diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index b0c0a3d..47f0ed6 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -22,14 +22,15 @@ jobs: fail-fast: false matrix: usd: ["v24.08", "v25.05.01"] - python: ["3.10", "3.12"] + python: ["", "3.10", "3.12"] - name: "USD-${{ matrix.usd }}-py${{ matrix.python }}" + name: "USD-${{ matrix.usd }}${{ matrix.python != '' && format('-py{0}', matrix.python) || '-no-py' }}" steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python }} + if: matrix.python != '' uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} @@ -37,10 +38,14 @@ jobs: - name: Create Build Environment run: | vcpkg install --triplet=x64-windows gtest - python -m pip install -r ${{github.workspace}}\test\requirements.txt cmake -E make_directory ${{github.workspace}}\build cmake -E make_directory ${{runner.temp}}\USD + - name: Install test Python deps + if: matrix.python != '' + run: | + python -m pip install -r ${{github.workspace}}/test/requirements.txt + - name: Download USD working-directory: ${{runner.temp}}/USD shell: cmd @@ -58,6 +63,7 @@ jobs: sed -i '/BOOST_URL/ s|\.zip"|.zip/download"|' src/build_scripts/build_usd.py - name: Install USD + if: matrix.python != '' working-directory: ${{runner.temp}}/USD shell: cmd run: | @@ -75,7 +81,28 @@ jobs: --no-materialx ^ -v + - name: Install USD (without Python) + if: matrix.python == '' + working-directory: ${{runner.temp}}/USD + shell: cmd + run: | + call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" + set VCPKG_TARGET_TRIPLET=x64-windows + set CMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake + python ./src/build_scripts/build_usd.py . ^ + --generator "Visual Studio 17 2022" ^ + --no-tests ^ + --no-examples ^ + --no-tutorials ^ + --no-tools ^ + --no-docs ^ + --no-imaging ^ + --no-materialx ^ + --no-python ^ + -v + - name: Configure & Build + if: matrix.python != '' shell: bash working-directory: ${{github.workspace}}/build run: | @@ -91,6 +118,23 @@ jobs: .. cmake --build . --config Release + - name: Configure & Build (without Python) + if: matrix.python == '' + shell: bash + working-directory: ${{github.workspace}}/build + run: | + export PATH="${{runner.temp}}/USD/bin;${{runner.temp}}/USD/lib;${PATH}" + cmake \ + -G "Visual Studio 17 2022" -A x64 \ + -D "CMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" \ + -D "VCPKG_TARGET_TRIPLET=x64-windows" \ + -D "BUILD_DOCS=OFF" \ + -D "BUILD_PYTHON_BINDINGS=OFF" \ + -D "CMAKE_INCLUDE_PATH=${{runner.temp}}/USD/include" \ + -D "CMAKE_LIBRARY_PATH=${{runner.temp}}/USD/lib" \ + .. + cmake --build . --config Release + - name: Check for formatting errors shell: bash working-directory: ${{github.workspace}}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index 285c530..ee4a3e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,11 +105,6 @@ if(BUILD_PYTHON_BINDINGS) CACHE INTERNAL "Python library path.") endif() -# usd::usd target always requres Boost::Boost -if (NOT TARGET Boost::Boost) - find_package(Boost REQUIRED) -endif() - add_subdirectory(src) if (BUILD_TESTS) diff --git a/cmake/modules/FindUSD.cmake b/cmake/modules/FindUSD.cmake index 9e86318..a016aba 100644 --- a/cmake/modules/FindUSD.cmake +++ b/cmake/modules/FindUSD.cmake @@ -85,9 +85,8 @@ if(USD_INCLUDE_DIR AND EXISTS "${USD_INCLUDE_DIR}/pxr/pxr.h") # if internal Boost.Python is not explicitly disabled if (USD_VERSION VERSION_LESS "0.25.5" OR _use_external_boost_python) set(USD_USE_INTERNAL_BOOST_PYTHON OFF CACHE INTERNAL "") - list(APPEND USD_DEPENDENCIES "Boost::boost") if (BUILD_PYTHON_BINDINGS) - list(APPEND USD_DEPENDENCIES "Boost::python") + list(APPEND USD_DEPENDENCIES "Boost::boost" "Boost::python") endif() endif() diff --git a/doc/sphinx/release/release_notes.rst b/doc/sphinx/release/release_notes.rst index 177284a..68e11be 100644 --- a/doc/sphinx/release/release_notes.rst +++ b/doc/sphinx/release/release_notes.rst @@ -7,13 +7,14 @@ Release Notes .. release:: 0.9.0 :date: Upcoming - .. change:: changed + .. change:: changed Performance improvements for the Merge operation. .. change:: fixed - Improved cmake packaging when building against a Python-free USD. + Removed the :term:`Boost` dependency for OpenUSD versions prior to + 25.05 when Python bindings aren’t needed. .. release:: 0.8.4 :date: 2025-07-30 diff --git a/src/unf/broker.cpp b/src/unf/broker.cpp index 8507aec..059c8f2 100644 --- a/src/unf/broker.cpp +++ b/src/unf/broker.cpp @@ -43,10 +43,7 @@ BrokerPtr Broker::Create(const UsdStageWeakPtr& stage) return Registry[stage]; } -const UsdStageWeakPtr -Broker::GetStage() const { - return _stage; -} +const UsdStageWeakPtr Broker::GetStage() const { return _stage; } bool Broker::IsInTransaction() { return _mergers.size() > 0; } diff --git a/src/unf/notice.cpp b/src/unf/notice.cpp index a1e4ae6..19970dc 100644 --- a/src/unf/notice.cpp +++ b/src/unf/notice.cpp @@ -65,9 +65,9 @@ void ObjectsChanged::Merge(ObjectsChanged&& notice) { // Update resyncChanges if necessary. for (auto& path : notice._resyncChanges) { - const auto iter = std::find(_resyncChanges.begin(), _resyncChanges.end(), path); - if (iter == _resyncChanges.end()) - { + const auto iter = + std::find(_resyncChanges.begin(), _resyncChanges.end(), path); + if (iter == _resyncChanges.end()) { _resyncChanges.emplace_back(std::move(path)); } } @@ -80,8 +80,7 @@ void ObjectsChanged::Merge(ObjectsChanged&& notice) { const auto it = std::find( _resyncChanges.begin(), _resyncChanges.end(), primPath); - if (it != _resyncChanges.end()) - continue; + if (it != _resyncChanges.end()) continue; } // Skip if an ancestor of the path is already in resyncedPaths. @@ -96,8 +95,8 @@ void ObjectsChanged::Merge(ObjectsChanged&& notice) // Add infoChanges, when not already available { - const auto it = std::find( - _infoChanges.begin(), _infoChanges.end(), path); + const auto it = + std::find(_infoChanges.begin(), _infoChanges.end(), path); if (it == _infoChanges.end()) { _infoChanges.push_back(std::move(path)); }