From 9caa3b84a4d6d26fa77c33db47059fa64d415dc3 Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Fri, 9 Oct 2026 11:14:29 -0700 Subject: [PATCH 1/2] Build C++ templates for CI and report results properly --- .github/workflows/templates.yml | 2 ++ build/GenerateTemplates.proj | 25 ++++++++++++++----- .../PropertySheets/Rhino.Cpp.Common.props | 23 +++++++++++++++++ .../PropertySheets/Rhino.Cpp.PlugIn.props | 6 +++++ .../Rhino.Cpp.PlugInComponent.props | 3 +++ build/WriteTemplateSummary.ps1 | 10 +++++--- 6 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.Common.props create mode 100644 build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.PlugIn.props create mode 100644 build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.PlugInComponent.props diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml index 625902c..f958394 100644 --- a/.github/workflows/templates.yml +++ b/.github/workflows/templates.yml @@ -6,6 +6,7 @@ on: paths: - 'Rhino.Templates/**' - 'build/GenerateTemplates.proj' + - 'build/RhinoSdkCpp/**' - 'build/WriteTemplateSummary.ps1' - '.github/workflows/templates.yml' pull_request: @@ -13,6 +14,7 @@ on: paths: - 'Rhino.Templates/**' - 'build/GenerateTemplates.proj' + - 'build/RhinoSdkCpp/**' - 'build/WriteTemplateSummary.ps1' - '.github/workflows/templates.yml' workflow_dispatch: diff --git a/build/GenerateTemplates.proj b/build/GenerateTemplates.proj index 02ec00e..5525cd6 100644 --- a/build/GenerateTemplates.proj +++ b/build/GenerateTemplates.proj @@ -14,6 +14,8 @@ $([System.IO.Path]::Combine($([MSBuild]::NormalizeDirectory($(MSBuildThisFileDirectory), '..', 'artifacts')), 'rhino_sdk_cpp')) + + "/p:RhinoSdkPath=$(MSBuildThisFileDirectory)RhinoSdkCpp/" "/p:RhinoSdkCppDir=$(RhinoSdkCppDir)" @@ -47,9 +49,14 @@ ConsoleToMSBuild="true"> + + + "$(VSMSBuild2019)" "$(VSMSBuild2022)" + "$(VSMSBuild2026)" @@ -79,7 +86,7 @@ - + @@ -129,14 +136,18 @@ - + + + - + - + + + @@ -144,7 +155,7 @@ - + @@ -161,7 +172,9 @@ - + + + diff --git a/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.Common.props b/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.Common.props new file mode 100644 index 0000000..a41e8a6 --- /dev/null +++ b/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.Common.props @@ -0,0 +1,23 @@ + + + + $([MSBuild]::EnsureTrailingSlash($(RhinoSdkCppDir))) + $(RhinoSdkDir)inc + $(RhinoSdkDir)lib + + + + $(RhinoIncDir);%(AdditionalIncludeDirectories) + RHINO_LIB_DIR="$(RhinoLibDir.Replace('\','/'))";%(PreprocessorDefinitions) + + RHINO_DEBUG_PLUGIN;%(PreprocessorDefinitions) + /d2Zi+ %(AdditionalOptions) + + + $(RhinoIncDir);%(AdditionalIncludeDirectories) + + + diff --git a/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.PlugIn.props b/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.PlugIn.props new file mode 100644 index 0000000..d33fe77 --- /dev/null +++ b/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.PlugIn.props @@ -0,0 +1,6 @@ + + + + .rhp + + diff --git a/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.PlugInComponent.props b/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.PlugInComponent.props new file mode 100644 index 0000000..02593f5 --- /dev/null +++ b/build/RhinoSdkCpp/PropertySheets/Rhino.Cpp.PlugInComponent.props @@ -0,0 +1,3 @@ + + + diff --git a/build/WriteTemplateSummary.ps1 b/build/WriteTemplateSummary.ps1 index 7ce37a0..30617f0 100644 --- a/build/WriteTemplateSummary.ps1 +++ b/build/WriteTemplateSummary.ps1 @@ -19,10 +19,14 @@ function Get-Diagnostics([string]$logPath) { } $root = (Resolve-Path $TemplateDir).Path -$projects = Get-ChildItem $root -Recurse -File -Include *.csproj, *.vbproj, *.vcxproj | - Where-Object { $_.FullName -notmatch '[\\/](bin|obj)[\\/]' } | +# C++ folders hold a .vcxproj, .xcodeproj and/or CMakeLists.txt; count each folder once. +# build and SDK hold CMake/Xcode output and the linked Rhino C++ SDK, which has its own samples. +$projects = Get-ChildItem $root -Recurse -Include *.csproj, *.vbproj, *.vcxproj, *.xcodeproj, CMakeLists.txt | + Where-Object { [IO.Path]::GetRelativePath($root, $_.FullName) -notmatch '(^|[\\/])(bin|obj|build|SDK)[\\/]|\.xcodeproj[\\/]' } | + ForEach-Object { [IO.Path]::GetDirectoryName($_.FullName) } | + Sort-Object -Unique | ForEach-Object { - $dir = $_.Directory.FullName + $dir = $_ $errorLog = Join-Path $dir 'build.errors.log' $warnings = @(Get-Diagnostics (Join-Path $dir 'build.warnings.log')) $errors = @(Get-Diagnostics $errorLog) From d1fd56f0e8ce5db84fb562c43d5d927370741920 Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Fri, 9 Oct 2026 11:50:10 -0700 Subject: [PATCH 2/2] Fix build warnings --- Rhino.Templates/content/CPPRhino/CMakeLists.txt | 9 ++++++++- Rhino.Templates/content/CPPRhino/stdafx.h | 8 ++++---- .../content/CSRhinoTest/MyRhino.1Tests.csproj | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Rhino.Templates/content/CPPRhino/CMakeLists.txt b/Rhino.Templates/content/CPPRhino/CMakeLists.txt index c66908a..506432b 100644 --- a/Rhino.Templates/content/CPPRhino/CMakeLists.txt +++ b/Rhino.Templates/content/CPPRhino/CMakeLists.txt @@ -46,7 +46,14 @@ endif() add_library(${PLUGIN_TARGET} MODULE ${SOURCES}) set_target_properties(${PLUGIN_TARGET} PROPERTIES OUTPUT_NAME "${PLUGIN_NAME}") -target_include_directories(${PLUGIN_TARGET} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${RHINO_SDK}/inc") +target_include_directories(${PLUGIN_TARGET} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +if(APPLE) + # The SDK headers warn about their own include casing and deprecations; the Xcode + # project silences these with the SDK's xcconfig, here they're system headers instead. + target_include_directories(${PLUGIN_TARGET} SYSTEM PRIVATE "${RHINO_SDK}/inc") +else() + target_include_directories(${PLUGIN_TARGET} PRIVATE "${RHINO_SDK}/inc") +endif() if(WIN32) # Rhino plug-ins always link the release CRT and MFC, even when built with diff --git a/Rhino.Templates/content/CPPRhino/stdafx.h b/Rhino.Templates/content/CPPRhino/stdafx.h index 5a634c9..2e315bf 100755 --- a/Rhino.Templates/content/CPPRhino/stdafx.h +++ b/Rhino.Templates/content/CPPRhino/stdafx.h @@ -8,10 +8,10 @@ #if defined(__APPLE__) // Rhino SDK for macOS; the Windows headers below are MFC-only. -#include "SDK/inc/rhinoSdkStdafxPreamble.h" -#include "SDK/inc/rhinoSdk.h" -#include "SDK/inc/RhRdkHeaders.h" -#include "SDK/inc/rhinoSdkChecks.h" +#include "rhinoSdkStdafxPreamble.h" +#include "rhinoSdk.h" +#include "RhRdkHeaders.h" +#include "rhinoSdkChecks.h" // Windows definitions the template code uses, which the Mac SDK does not declare. #ifndef MB_OK diff --git a/Rhino.Templates/content/CSRhinoTest/MyRhino.1Tests.csproj b/Rhino.Templates/content/CSRhinoTest/MyRhino.1Tests.csproj index 4bda59d..3ed4f80 100644 --- a/Rhino.Templates/content/CSRhinoTest/MyRhino.1Tests.csproj +++ b/Rhino.Templates/content/CSRhinoTest/MyRhino.1Tests.csproj @@ -30,6 +30,7 @@ +