From b053d8689292db37189465def90c67f9e72a2cda Mon Sep 17 00:00:00 2001 From: demianmnave Date: Tue, 19 Nov 2024 16:16:27 -0500 Subject: [PATCH] Build and test with the system MSVC --- .clang-format | 282 +++++++++++++++++------------------ .github/workflows/msvc17.yml | 58 ++++--- CMakePresets.json | 15 ++ 3 files changed, 194 insertions(+), 161 deletions(-) diff --git a/.clang-format b/.clang-format index 642eb4a..232dd1e 100644 --- a/.clang-format +++ b/.clang-format @@ -1,142 +1,142 @@ ---- -Language: Cpp -AccessModifierOffset: 0 -AlignAfterOpenBracket: DontAlign -AlignArrayOfStructures: None -AlignConsecutiveAssignments: None -AlignConsecutiveBitFields: AcrossEmptyLinesAndComments -AlignConsecutiveDeclarations: None -AlignConsecutiveMacros: None -AlignEscapedNewlines: Right -AlignOperands: DontAlign -AlignTrailingComments: true -AllowAllArgumentsOnNextLine: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: Empty -AllowShortCaseLabelsOnASingleLine: true -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: InlineOnly -AllowShortIfStatementsOnASingleLine: AllIfsAndElse -AllowShortLambdasOnASingleLine: All -AllowShortLoopsOnASingleLine: true -AlwaysBreakAfterReturnType: TopLevelDefinitions -AlwaysBreakBeforeMultilineStrings: true -AlwaysBreakTemplateDeclarations: MultiLine -BinPackArguments: true -BinPackParameters: true -BitFieldColonSpacing: Both -BraceWrapping: - AfterCaseLabel: false - AfterClass: true - AfterControlStatement: MultiLine - AfterEnum: true - AfterFunction: true - AfterNamespace: false - AfterStruct: true - AfterUnion: true - AfterExternBlock: false - BeforeCatch: false - BeforeElse: false - BeforeLambdaBody: false - BeforeWhile: false - IndentBraces: false - SplitEmptyFunction: false - SplitEmptyRecord: false - SplitEmptyNamespace: false -BreakAfterAttributes: Leave -BreakBeforeBinaryOperators: NonAssignment -BreakBeforeBraces: Custom -BreakBeforeConceptDeclarations: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializers: BeforeComma -BreakInheritanceList: BeforeComma -BreakStringLiterals: false -ColumnLimit: 80 -CompactNamespaces: false -ConstructorInitializerIndentWidth: 0 -ContinuationIndentWidth: 2 -Cpp11BracedListStyle: true -DeriveLineEnding: false -DerivePointerAlignment: false -EmptyLineAfterAccessModifier: Never -EmptyLineBeforeAccessModifier: Always -ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: true -ForEachMacros: ['foreach', 'Q_FOREACH', 'BOOST_FOREACH'] -IncludeBlocks: Preserve -IndentAccessModifiers: false -IndentCaseBlocks: false -IndentCaseLabels: true -IndentExternBlock: NoIndent -IndentGotoLabels: false -IndentPPDirectives: AfterHash -IndentRequires: true -IndentWidth: 2 -IndentWrappedFunctionNames: false -InsertBraces: false -InsertNewlineAtEOF: true -IntegerLiteralSeparator: - Binary: 4 - Decimal: 0 - Hex: 2 -KeepEmptyLinesAtTheStartOfBlocks: false -LambdaBodyIndentation: Signature -LineEnding: LF -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 2 -NamespaceIndentation: None -NamespaceMacros: [] -PPIndentWidth: -1 -PackConstructorInitializers: BinPack -PenaltyBreakAssignment: 2 -PenaltyBreakBeforeFirstCallParameter: 2 -PenaltyBreakComment: 2 -PenaltyBreakFirstLessLess: 10 -PenaltyBreakOpenParenthesis: 100 -PenaltyBreakString: 1000 -PenaltyBreakTemplateDeclaration: 2 -PenaltyExcessCharacter: 100000 -PenaltyIndentedWhitespace: 100 -PenaltyReturnTypeOnItsOwnLine: 1000 -PointerAlignment: Left -QualifierAlignment: Leave -ReferenceAlignment: Pointer -ReflowComments: false -RemoveBracesLLVM: false -SeparateDefinitionBlocks: Always -ShortNamespaceLines: 1 -SortIncludes: Never -SortUsingDeclarations: false -SpaceAfterCStyleCast: true -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: false -SpaceAroundPointerQualifiers: Default -SpaceBeforeAssignmentOperators: true -SpaceBeforeCaseColon: false -SpaceBeforeCpp11BracedList: false -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeParens: Never -SpaceBeforeRangeBasedForLoopColon: true -SpaceBeforeSquareBrackets: false -SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 2 -SpacesInAngles: Never -SpacesInCStyleCastParentheses: false -SpacesInConditionalStatement: false -SpacesInContainerLiterals: true -SpacesInLineCommentPrefix: - Minimum: 1 - Maximum: -1 -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Latest -StatementAttributeLikeMacros: [] -StatementMacros: [] -TypenameMacros: [] -TabWidth: 4 -UseCRLF: false -UseTab: Never +--- +Language: Cpp +AccessModifierOffset: 0 +AlignAfterOpenBracket: DontAlign +AlignArrayOfStructures: None +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: AcrossEmptyLinesAndComments +AlignConsecutiveDeclarations: None +AlignConsecutiveMacros: None +AlignEscapedNewlines: Right +AlignOperands: DontAlign +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: true +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: InlineOnly +AllowShortIfStatementsOnASingleLine: AllIfsAndElse +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterReturnType: TopLevelDefinitions +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BitFieldColonSpacing: Both +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: MultiLine + AfterEnum: true + AfterFunction: true + AfterNamespace: false + AfterStruct: true + AfterUnion: true + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakAfterAttributes: Leave +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeBraces: Custom +BreakBeforeConceptDeclarations: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeComma +BreakStringLiterals: false +ColumnLimit: 80 +CompactNamespaces: false +ConstructorInitializerIndentWidth: 0 +ContinuationIndentWidth: 2 +Cpp11BracedListStyle: true +DeriveLineEnding: false +DerivePointerAlignment: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: Always +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: [] +IncludeBlocks: Preserve +IndentAccessModifiers: false +IndentCaseBlocks: false +IndentCaseLabels: true +IndentExternBlock: NoIndent +IndentGotoLabels: false +IndentPPDirectives: AfterHash +IndentRequires: true +IndentWidth: 2 +IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: true +IntegerLiteralSeparator: + Binary: 4 + Decimal: 0 + Hex: 2 +KeepEmptyLinesAtTheStartOfBlocks: false +LambdaBodyIndentation: Signature +LineEnding: LF +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +NamespaceMacros: [] +PPIndentWidth: -1 +PackConstructorInitializers: BinPack +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 2 +PenaltyBreakComment: 2 +PenaltyBreakFirstLessLess: 10 +PenaltyBreakOpenParenthesis: 100 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 2 +PenaltyExcessCharacter: 100000 +PenaltyIndentedWhitespace: 100 +PenaltyReturnTypeOnItsOwnLine: 1000 +PointerAlignment: Left +QualifierAlignment: Leave +ReferenceAlignment: Pointer +ReflowComments: false +RemoveBracesLLVM: false +SeparateDefinitionBlocks: Always +ShortNamespaceLines: 1 +SortIncludes: Never +SortUsingDeclarations: false +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: false +SpaceAroundPointerQualifiers: Default +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: Never +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: Never +SpacesInCStyleCastParentheses: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: true +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Latest +StatementAttributeLikeMacros: [] +StatementMacros: [] +TypenameMacros: [] +TabWidth: 4 +UseCRLF: false +UseTab: Never WhitespaceSensitiveMacros: [] \ No newline at end of file diff --git a/.github/workflows/msvc17.yml b/.github/workflows/msvc17.yml index 78d4e0a..948e5fe 100644 --- a/.github/workflows/msvc17.yml +++ b/.github/workflows/msvc17.yml @@ -4,26 +4,13 @@ name: msvc17 on: push jobs: - job: - name: MSVC 17.10 + msvc-latest: + name: MSVC Latest runs-on: windows-2022 steps: - - name: Install MSVC 17.10 - shell: pwsh - run: | - $vspath = 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise' - Test-Path -Path $vspath | Should -Be $true - - $vsinstaller = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' - Test-Path -Path $vsinstaller | Should -Be $true - - Start-Process -NoNewWindow -Wait -FilePath $vsinstaller -ArgumentList ` - 'modify', '--installPath', "`"$vspath`"", '--quiet', '--norestart', '--nocache', '--noUpdateInstaller', ` - '--add', 'Microsoft.VisualStudio.Component.VC.14.40.17.10.x86.x64' - - uses: lukka/get-cmake@latest with: - cmakeVersion: "~3.27.0" + cmakeVersion: "~3.29.0" useCloudCache: true - uses: actions/checkout@v4 @@ -31,7 +18,38 @@ jobs: - name: CMake configure-build-test uses: lukka/run-cmake@v10 with: - configurePreset: "cml-ci-msvc17-mt-s" - configurePresetAdditionalArgs: "['-T version=14.40']" - buildPreset: "cml-ci-msvc17-mt-s-release" - testPreset: "cml-ci-msvc17-mt-s-release-test" \ No newline at end of file + configurePreset: "cml-ci-ninja-msvc-mt-s" + buildPreset: "cml-ci-ninja-msvc-mt-s-release" + testPreset: "cml-ci-ninja-msvc-mt-s-release-test" + +# msvc-17-10: +# name: MSVC 17.10 +# runs-on: windows-2022 +# steps: +# - name: Install MSVC 17.10 +# shell: pwsh +# run: | +# $vspath = 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise' +# Test-Path -Path $vspath | Should -Be $true +# +# $vsinstaller = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe' +# Test-Path -Path $vsinstaller | Should -Be $true +# +# Start-Process -NoNewWindow -Wait -FilePath $vsinstaller -ArgumentList ` +# 'modify', '--installPath', "`"$vspath`"", '--quiet', '--norestart', '--nocache', '--noUpdateInstaller', ` +# '--add', 'Microsoft.VisualStudio.Component.VC.14.40.17.10.x86.x64' +# +# - uses: lukka/get-cmake@latest +# with: +# cmakeVersion: "~3.29.0" +# useCloudCache: true +# +# - uses: actions/checkout@v4 +# +# - name: CMake configure-build-test +# uses: lukka/run-cmake@v10 +# with: +# configurePreset: "cml-ci-msvc17-mt-s" +# configurePresetAdditionalArgs: "['-T version=14.40']" +# buildPreset: "cml-ci-msvc17-mt-s-release" +# testPreset: "cml-ci-msvc17-mt-s-release-test" \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json index 50f3bc1..d19afb9 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -187,6 +187,14 @@ } }, + { + // Static Ninja+MSVC release build: + "name": "cml-ci-ninja-msvc-mt-s-release", + "inherits": [ ".cml-windows-build-only" ], + "configurePreset": "cml-ci-ninja-msvc-mt-s", + "inheritConfigureEnvironment": true, + "configuration": "Release" + }, { // Static Ninja+ClangCl release build: "name": "cml-ci-ninja-msvc-clangcl-mt-s-release", @@ -222,6 +230,13 @@ } }, + { + "name": "cml-ci-ninja-msvc-mt-s-release-test", + "inherits": [ ".cml-windows-test-only" ], + "configurePreset": "cml-ci-ninja-msvc-mt-s", + "inheritConfigureEnvironment": true, + "configuration": "Release" + }, { "name": "cml-ci-ninja-msvc-clangcl-mt-s-release-test", "inherits": [ ".cml-windows-test-only" ],