diff --git a/CMakeLists.txt b/CMakeLists.txt index 1997b85..4ff6232 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,7 +298,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if(ENABLE_CODE_ANALYSIS) foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) - target_compile_options(${t} PRIVATE /analyze) + target_compile_options(${t} PRIVATE /analyze /WX) endforeach() endif() diff --git a/README.md b/README.md index e28aa4a..f7a907e 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,10 @@ Sander et al. "Signal-Specialized Parametrization" Europgraphics 2002 [pdf](http ## Release Notes +FOR SECURITY ADVISORIES, see [GitHub](https://github.com/microsoft/UVAtlas/security/advisories). + +For a full change history, see [CHANGELOG.md](https://github.com/microsoft/UVAtlas/blob/main/CHANGELOG.md). + * Starting with the December 2020 release, this library makes use of typed enum bitmask flags per the recommendation of the _C++ Standard_ section *17.5.2.1.3 Bitmask types*. This is consistent with Direct3D 12's use of the ``DEFINE_ENUM_FLAG_OPERATORS`` macro. This may have *breaking change* impacts to client code: * You cannot pass the ``0`` literal as your option flags value. Instead you must make use of the appropriate default enum value: ``UVATLAS_DEFAULT`` or ``UVATLAS_IMT_DEFAULT``. @@ -78,6 +82,8 @@ This project welcomes contributions and suggestions. Most contributions require When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. +Tests for new features should also be submitted as a PR to the [Test Suite](https://github.com/walbourn/uvatlastest/wiki) repository. + ## Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. @@ -86,4 +92,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. +# Credits + +The UVAtlas library is the work of Xin Huang and Chuck Walbourn, with contributions from Chris Messer, Steve Schroeder, Microsoft Research China, and Team Bungie. + Thanks to Andrew Farrier and Scott Matloff for their on-going help with code reviews. diff --git a/UVAtlas/UVAtlas_Windows10_2022.vcxproj b/UVAtlas/UVAtlas_Windows10_2022.vcxproj index a3762cb..8bef7f5 100644 --- a/UVAtlas/UVAtlas_Windows10_2022.vcxproj +++ b/UVAtlas/UVAtlas_Windows10_2022.vcxproj @@ -97,7 +97,7 @@ true Windows Store 10.0 - 10.0.17763.0 + 10.0.18362.0 10.0 diff --git a/UVAtlas/isochart/isochartengine.cpp b/UVAtlas/isochart/isochartengine.cpp index 30bcdb1..abfa265 100644 --- a/UVAtlas/isochart/isochartengine.cpp +++ b/UVAtlas/isochart/isochartengine.cpp @@ -285,6 +285,9 @@ HRESULT CIsochartEngine::InitializeCurrentChartHeap() } #ifdef _OPENMP +#ifdef _MSC_VER +#pragma warning(disable : 6993) +#endif HRESULT CIsochartEngine::ParameterizeChartsInHeapParallelized( bool bFirstTime, size_t MaxChartNumber) diff --git a/build/UVAtlas-GitHub-Dev17.yml b/build/UVAtlas-GitHub-Dev17.yml index b0e1b32..f7265dd 100644 --- a/build/UVAtlas-GitHub-Dev17.yml +++ b/build/UVAtlas-GitHub-Dev17.yml @@ -12,15 +12,36 @@ schedules: include: - main -trigger: none +trigger: + branches: + include: + - main + paths: + exclude: + - '*.md' + - LICENSE + - CMake* + - '.nuget/*' + - build/*.cmake + - build/*.in + - build/*.mdb + - build/*.ps1 pr: branches: include: - main paths: - include: - - build/UVAtlas-GitHub-Dev17.yml + exclude: + - '*.md' + - LICENSE + - CMake* + - '.nuget/*' + - build/*.cmake + - build/*.in + - build/*.mdb + - build/*.ps1 + drafts: false resources: repositories: diff --git a/build/UVAtlas-GitHub-Test-Dev17.yml b/build/UVAtlas-GitHub-Test-Dev17.yml index 96d847e..698aeea 100644 --- a/build/UVAtlas-GitHub-Test-Dev17.yml +++ b/build/UVAtlas-GitHub-Test-Dev17.yml @@ -29,6 +29,7 @@ pool: variables: Codeql.Enabled: false + VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' GITHUB_PAT: $(GITHUBPUBLICTOKEN) jobs: @@ -138,20 +139,13 @@ jobs: script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/uvatlastest.git Tests workingDirectory: $(Build.SourcesDirectory) failOnStderr: true - - task: ChocolateyCommand@0 - displayName: Install Ninja - inputs: - command: 'install' - installPackageId: 'ninja' - task: CmdLine@2 - displayName: 'Setup environment for CMake to use VS' + displayName: Setup environment for CMake to use VS inputs: script: | - @echo off - pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" - for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x - popd - call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat" + echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath% + echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin echo ##vso[task.prependpath]%WindowsSdkBinPath%x64 echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64 @@ -213,14 +207,10 @@ jobs: inputs: Contents: 'out' - task: CmdLine@2 - displayName: 'Set LIB for ARM64' + displayName: Switch compiler to ARM64 inputs: script: | - @echo off - pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" - for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x - popd - call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" arm64 + call "$(VC_PATH)\Auxiliary\Build\vcvarsamd64_arm64.bat" echo ##vso[task.setvariable variable=LIB;]%LIB% - task: CMake@1 diff --git a/build/UVAtlas-GitHub.yml b/build/UVAtlas-GitHub.yml index abfcc55..7edc15f 100644 --- a/build/UVAtlas-GitHub.yml +++ b/build/UVAtlas-GitHub.yml @@ -51,13 +51,13 @@ resources: name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) +pool: + vmImage: windows-2019 + variables: Codeql.Enabled: false GUID_FEED: $(ADOFeedGUID) -pool: - vmImage: windows-2022 - jobs: - job: DESKTOP_BUILD displayName: 'Win32 Desktop' @@ -176,54 +176,3 @@ jobs: msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=Spectre platform: ARM64 configuration: Release - -- job: UWP_BUILD - displayName: 'Universal Windows Platform (UWP)' - timeoutInMinutes: 60 - cancelTimeoutInMinutes: 1 - steps: - - checkout: self - clean: true - fetchTags: false - - task: VSBuild@1 - displayName: Build solution UVAtlas_Windows10_2022.sln 32dbg - inputs: - solution: UVAtlas_Windows10_2022.sln - msbuildArgs: /p:PreferredToolArchitecture=x64 - platform: x86 - configuration: Debug - - task: VSBuild@1 - displayName: Build solution UVAtlas_Windows10_2022.sln 32rel - inputs: - solution: UVAtlas_Windows10_2022.sln - msbuildArgs: /p:PreferredToolArchitecture=x64 - platform: x86 - configuration: Release - - task: VSBuild@1 - displayName: Build solution UVAtlas_Windows10_2022.sln 64dbg - inputs: - solution: UVAtlas_Windows10_2022.sln - msbuildArgs: /p:PreferredToolArchitecture=x64 - platform: x64 - configuration: Debug - - task: VSBuild@1 - displayName: Build solution UVAtlas_Windows10_2022.sln 64rel - inputs: - solution: UVAtlas_Windows10_2022.sln - msbuildArgs: /p:PreferredToolArchitecture=x64 - platform: x64 - configuration: Release - - task: VSBuild@1 - displayName: Build solution UVAtlas_Windows10_2022.sln arm64dbg - inputs: - solution: UVAtlas_Windows10_2022.sln - msbuildArgs: /p:PreferredToolArchitecture=x64 - platform: ARM64 - configuration: Debug - - task: VSBuild@1 - displayName: Build solution UVAtlas_Windows10_2022.sln arm64rel - inputs: - solution: UVAtlas_Windows10_2022.sln - msbuildArgs: /p:PreferredToolArchitecture=x64 - platform: ARM64 - configuration: Release diff --git a/build/UVAtlas-SDL.yml b/build/UVAtlas-SDL.yml index 537ea16..7972035 100644 --- a/build/UVAtlas-SDL.yml +++ b/build/UVAtlas-SDL.yml @@ -27,6 +27,7 @@ variables: Codeql.Enabled: true Codeql.Language: cpp Codeql.ExcludePathPatterns: vcpkg + VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' VS_GENERATOR: 'Visual Studio 17 2022' VCPKG_CMAKE_DIR: '$(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake' GITHUB_PAT: $(GITHUBPUBLICTOKEN) @@ -166,3 +167,37 @@ jobs: GdnBreakPolicyMinSev: 'Error' - task: ComponentGovernanceComponentDetection@0 displayName: Component Detection + +- job: VC_PREFAST + displayName: 'Build using /analyze (PREFAST)' + workspace: + clean: all + steps: + - checkout: self + clean: true + fetchTags: false + - task: CmdLine@2 + displayName: Setup environment for CMake to use VS + inputs: + script: | + call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat" + echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath% + echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja + echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin + echo ##vso[task.prependpath]%WindowsSdkBinPath%x64 + echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64 + echo ##vso[task.prependpath]%VCToolsInstallDir%bin\Hostx64\x64 + echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE% + echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE% + echo ##vso[task.setvariable variable=LIB;]%LIB% + + - task: CMake@1 + displayName: CMake Config + inputs: + cwd: '$(Build.SourcesDirectory)' + cmakeArgs: --preset=x64-Debug -DENABLE_CODE_ANALYSIS=ON + - task: CMake@1 + displayName: CMake Build + inputs: + cwd: '$(Build.SourcesDirectory)' + cmakeArgs: --build out/build/x64-Debug