From cf0a8ff1777194d94f3696d8db5acf7b07d4e0ce Mon Sep 17 00:00:00 2001 From: Luca Scheller Date: Sat, 27 Jul 2024 19:37:21 -0700 Subject: [PATCH] Adjust build matrix and compilers to support msvc 2022 --- .github/scripts/houdini_build.bat | 2 +- .github/workflows/build_houdini.yml | 78 +++++++++++++++++++++------ CMakeLists.txt | 1 + build.bat | 3 +- docs/src/installation/requirements.md | 5 +- 5 files changed, 69 insertions(+), 20 deletions(-) diff --git a/.github/scripts/houdini_build.bat b/.github/scripts/houdini_build.bat index fcdfdfe..d244d72 100644 --- a/.github/scripts/houdini_build.bat +++ b/.github/scripts/houdini_build.bat @@ -1,6 +1,6 @@ set HFS=C:\Program Files\Side Effects Software\Houdini set AR_DCC_NAME=HOUDINI set AR_RESOLVER_NAME=%1 -cmake . -B build -G "Visual Studio 16 2019" -A x64 -T v142 +cmake . -B build -G %2 -A x64 -T %3 cmake --build build --clean-first --config Release cmake --install build \ No newline at end of file diff --git a/.github/workflows/build_houdini.yml b/.github/workflows/build_houdini.yml index 9acff97..b007a7e 100644 --- a/.github/workflows/build_houdini.yml +++ b/.github/workflows/build_houdini.yml @@ -85,26 +85,18 @@ jobs: name: UsdAssetResolver-linux-${{ matrix.houdini_product_name }}-${{ matrix.houdini_product_version }} path: artifacts/*.zip - build_windows: + build_windows_2019: runs-on: windows-2019 environment: houdini strategy: matrix: - houdini_product_name: ["houdini", "houdini-py310", "houdini-py39", "houdini-py37"] - houdini_product_version: ["19.5", "20.0", "20.5"] + houdini_product_name: ["houdini", "houdini-py39", "houdini-py37"] + houdini_product_version: ["19.5", "20.0"] exclude: - houdini_product_name: "houdini-py39" houdini_product_version: "19.5" - - houdini_product_name: "houdini-py310" - houdini_product_version: "19.5" - houdini_product_name: "houdini-py37" houdini_product_version: "20.0" - - houdini_product_name: "houdini-py310" - houdini_product_version: "20.0" - - houdini_product_name: "houdini-py37" - houdini_product_version: "20.5" - - houdini_product_name: "houdini-py39" - houdini_product_version: "20.5" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -133,16 +125,16 @@ jobs: python3 .github\scripts\houdini.py --install --install_houdini_product_name ${{ matrix.houdini_product_name }} --install_houdini_product_version ${{ matrix.houdini_product_version }} - name: Build USD File Resolver run: | - .\.github\scripts\houdini_build.bat fileResolver + .\.github\scripts\houdini_build.bat fileResolver "Visual Studio 16 2019" "v142" - name: Build USD Python Resolver run: | - .\.github\scripts\houdini_build.bat pythonResolver + .\.github\scripts\houdini_build.bat pythonResolver "Visual Studio 16 2019" "v142" - name: Build USD Cached Resolver run: | - .\.github\scripts\houdini_build.bat cachedResolver + .\.github\scripts\houdini_build.bat cachedResolver "Visual Studio 16 2019" "v142" - name: Build USD Http Resolver run: | - .\.github\scripts\houdini_build.bat httpResolver + .\.github\scripts\houdini_build.bat httpResolver "Visual Studio 16 2019" "v142" - name: Create single .zip archive run: | & python $pwd\.github\scripts\houdini.py --artifact --artifact_src=$pwd\dist --artifact_dst=$pwd\artifacts --artifact_prefix=UsdAssetResolver --artifact_product_name ${{ matrix.houdini_product_name }} @@ -152,11 +144,65 @@ jobs: name: UsdAssetResolver-windows-${{ matrix.houdini_product_name }}-${{ matrix.houdini_product_version }} path: artifacts/*.zip + build_windows_2022: + runs-on: windows-2022 + environment: houdini + strategy: + matrix: + houdini_product_name: ["houdini", "houdini-py310"] + houdini_product_version: ["20.5"] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Switch to latest release tag + run: | + git fetch --all --tags --force + $latest_release_tag=git tag -l --sort=-version:refname v* | select -first 1 + git checkout tags/$latest_release_tag + - name: Install system packages + run: | + pip3 install requests + # - name: Cache Houdini + # id: cache-houdini-windows + # uses: actions/cache@v3 + # with: + # path: "C:\\Program Files\\Side Effects Software" + # key: ${{ runner.os }}-houdini + - name: Install Houdini + # if: steps.cache-houdini-windows.outputs.cache-hit != 'true' + env: + SIDEFX_CLIENT_ID: '${{ secrets.SIDEFX_CLIENT_ID }}' + SIDEFX_CLIENT_SECRET_KEY: '${{ secrets.SIDEFX_CLIENT_SECRET_KEY }}' + run: | + python3 .github\scripts\houdini.py --install --install_houdini_product_name ${{ matrix.houdini_product_name }} --install_houdini_product_version ${{ matrix.houdini_product_version }} + - name: Build USD File Resolver + run: | + .\.github\scripts\houdini_build.bat fileResolver "Visual Studio 17 2022" "v143" + - name: Build USD Python Resolver + run: | + .\.github\scripts\houdini_build.bat pythonResolver "Visual Studio 17 2022" "v143" + - name: Build USD Cached Resolver + run: | + .\.github\scripts\houdini_build.bat cachedResolver "Visual Studio 17 2022" "v143" + - name: Build USD Http Resolver + run: | + .\.github\scripts\houdini_build.bat httpResolver "Visual Studio 17 2022" "v143" + - name: Create single .zip archive + run: | + & python $pwd\.github\scripts\houdini.py --artifact --artifact_src=$pwd\dist --artifact_dst=$pwd\artifacts --artifact_prefix=UsdAssetResolver --artifact_product_name ${{ matrix.houdini_product_name }} + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: UsdAssetResolver-windows-${{ matrix.houdini_product_name }}-${{ matrix.houdini_product_version }} + path: artifacts/*.zip + deploy: runs-on: ubuntu-latest permissions: contents: write - needs: [build_linux, build_windows] + needs: [build_linux, build_windows_2019, build_windows_2022] strategy: matrix: os: ["linux", "windows"] diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bd43fd..b9ca088 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,7 @@ cmake_minimum_required(VERSION 3.19 FATAL_ERROR) project(${AR_PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX) ### CPP Settings ### +set(CMAKE_CXX_STANDARD 17) set(BUILD_SHARED_LIBS ON) # Preprocessor Defines (Same as #define) add_compile_definitions(HBOOST_ALL_NO_LIB BOOST_ALL_NO_LIB) diff --git a/build.bat b/build.bat index e32afe0..81d9bc6 100644 --- a/build.bat +++ b/build.bat @@ -9,6 +9,7 @@ REM set AR_DCC_NAME=HOUDINI REM Clear existing build data and invoke cmake rmdir /S /Q build rmdir /S /Q dist -cmake . -B build -G "Visual Studio 16 2019" -A x64 -T v142 +REM Make sure to match the correct VS version the DCC was built with +cmake . -B build -G "Visual Studio 17 2022" -A x64 -T v143 cmake --build build --clean-first --config Release cmake --install build \ No newline at end of file diff --git a/docs/src/installation/requirements.md b/docs/src/installation/requirements.md index 967aabb..b7bde00 100644 --- a/docs/src/installation/requirements.md +++ b/docs/src/installation/requirements.md @@ -17,7 +17,7 @@ Since the Usd Asset Resolver API changed with the AR 2.0 standard proposed in th |------------------------|------------------------------------------------------------------------|----------------------|---------------| | gcc | [https://gcc.gnu.org](https://gcc.gnu.org/) | 11.2.1 | 13.1.1 | | cmake | [https://cmake.org](https://cmake.org/) | 3.26.4 | 3.26.4 | -| SideFX Houdini | [SideFX Houdini](https://www.sidefx.com) | 19.5 | 19.5 | +| SideFX Houdini | [SideFX Houdini](https://www.sidefx.com) | 19.5 | 20.5 | | Autodesk Maya | [Autodesk Maya](https://www.autodesk.com/ca-en/products/maya/overview) | 2024 | 2024 | | Autodesk Maya USD SDK | [Autodesk Maya USD SDK](https://github.com/Autodesk/maya-usd) | 0.27.0 | 0.27.0 | ``` @@ -26,7 +26,8 @@ Since the Usd Asset Resolver API changed with the AR 2.0 standard proposed in th ```admonish success title="" | Software | Website | Min (Not Tested) | Max (Tested) | |------------------------|------------------------------------------------------------------------------------|----------------------|---------------| -|Visual Studio 16 2019 | [https://visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/) | 11.2.1 | 13.1.1 | +|Visual Studio 16 2019 | [https://visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/) | - | - | +|Visual Studio 17 2022 | [https://visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/) | - | - | | cmake | [https://cmake.org](https://cmake.org/) | 3.26.4 | 3.26.4 | | SideFX Houdini | [SideFX Houdini](https://www.sidefx.com) | 19.5 | 19.5 | | Autodesk Maya | [Autodesk Maya](https://www.autodesk.com/ca-en/products/maya/overview) | 2024 | 2024 |