Skip to content

Commit

Permalink
Merge branch 'fix-github-synchro' into 'main'
Browse files Browse the repository at this point in the history
Fix github synchro. Import missing commits from github

See merge request Sharpmake/sharpmake!571
  • Loading branch information
jspelletier committed Oct 30, 2024
2 parents 07a920b + b58a7a5 commit f48b623
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout the repo
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

- name: Download sharpmake ${{ matrix.framework }} ${{ runner.os }}-release binaries
uses: actions/download-artifact@v4
Expand All @@ -58,7 +58,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout the repo
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

- name: Generate samples matrix
id: set-matrix
Expand All @@ -79,7 +79,7 @@ jobs:
matrix: ${{fromJSON(needs.generate_samples_matrix.outputs.matrix)}}
steps:
- name: Checkout the repo
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

# Setting a VS_VERSION_SUFFIX variable for use by steps that are using solutions specific to VS2019 or VS2022
- name: SetVSVersionSuffix-VS2019
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: Checkout the repo
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- name: 'Checkout the repo'
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0

Expand Down
1 change: 1 addition & 0 deletions Sharpmake.Generators/FastBuild/Bff.Template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ public static class ConfigurationFile
+ ' [cmdLineOptions.IgnoreStandardIncludePath]'
+ ' [cmdLineOptions.GeneratePreprocessedFile]'
+ ' [cmdLineOptions.KeepComments]'
+ ' [cmdLineOptions.UseStandardConformingPreprocessor]'
+ ' [cmdLineOptions.StringPooling]'
+ ' [cmdLineOptions.MinimalRebuild]'
+ ' [cmdLineOptions.ExceptionHandling]'
Expand Down
22 changes: 22 additions & 0 deletions Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,28 @@ private void GenerateCompilerOptions(IGenerationContext context, ProjectOptionsG
Options.Option(Options.Vc.Compiler.KeepComment.Enable, () => { context.Options["KeepComments"] = "true"; context.CommandLineOptions["KeepComments"] = "/C"; })
);

//Options.Vc.Compiler.UseStandardConformingPreprocessor. See: https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor?view=msvc-170
// Disable /Zc:preprocessor-
// Enable /Zc:preprocessor
context.SelectOption
(
Options.Option(Options.Vc.Compiler.UseStandardConformingPreprocessor.Default, () =>
{
context.Options["UseStandardConformingPreprocessor"] = FileGeneratorUtilities.RemoveLineTag;
context.CommandLineOptions["UseStandardConformingPreprocessor"] = FileGeneratorUtilities.RemoveLineTag;
}),
Options.Option(Options.Vc.Compiler.UseStandardConformingPreprocessor.Disable, () =>
{
context.Options["UseStandardConformingPreprocessor"] = "false";
context.CommandLineOptions["UseStandardConformingPreprocessor"] = "/Zc:preprocessor-";
}),
Options.Option(Options.Vc.Compiler.UseStandardConformingPreprocessor.Enable, () =>
{
context.Options["UseStandardConformingPreprocessor"] = "true";
context.CommandLineOptions["UseStandardConformingPreprocessor"] = "/Zc:preprocessor";
})
);

//Options.Vc.Compiler.StringPooling.
// Disable StringPooling="false"
// Enable StringPooling="true" /GF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public abstract partial class BasePlatform
<PreprocessToFile>[options.GeneratePreprocessedFile]</PreprocessToFile>
<PreprocessSuppressLineNumbers>[options.PreprocessSuppressLineNumbers]</PreprocessSuppressLineNumbers>
<PreprocessKeepComments>[options.KeepComments]</PreprocessKeepComments>
<UseStandardPreprocessor>[options.UseStandardConformingPreprocessor]</UseStandardPreprocessor>
<StringPooling>[options.StringPooling]</StringPooling>
<MinimalRebuild>[options.MinimalRebuild]</MinimalRebuild>
<ExceptionHandling>[options.ExceptionHandling]</ExceptionHandling>
Expand Down
11 changes: 11 additions & 0 deletions Sharpmake/Options.Vc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,17 @@ public enum KeepComment
Enable
}

/// <summary>
/// Enables a token-based preprocessor that conforms to C99 and C++11 and later standards.
/// </summary>
public enum UseStandardConformingPreprocessor
{
[Default]
Default,
Disable,
Enable
}

/// <summary>
/// Enables the compiler to create a single read-only copy of identical strings in the program image and in memory during execution, resulting in smaller programs, an optimization called string pooling. /O1, /O2, and /ZI automatically set /GF option.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Sharpmake/Sharpmake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.11.2177" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageReference Include="Basic.Reference.Assemblies.Net60" Version="1.7.8" />
<PackageReference Include="Basic.Reference.Assemblies.Net60" Version="1.7.9" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
Expand Down

0 comments on commit f48b623

Please sign in to comment.