Skip to content

Commit f48b623

Browse files
committed
Merge branch 'fix-github-synchro' into 'main'
Fix github synchro. Import missing commits from github See merge request Sharpmake/sharpmake!571
2 parents 07a920b + b58a7a5 commit f48b623

File tree

8 files changed

+41
-6
lines changed

8 files changed

+41
-6
lines changed

.github/workflows/actions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
steps:
4141
- name: Checkout the repo
42-
uses: actions/checkout@v4.1.7
42+
uses: actions/checkout@v4.2.2
4343

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

6363
- name: Generate samples matrix
6464
id: set-matrix
@@ -79,7 +79,7 @@ jobs:
7979
matrix: ${{fromJSON(needs.generate_samples_matrix.outputs.matrix)}}
8080
steps:
8181
- name: Checkout the repo
82-
uses: actions/checkout@v4.1.7
82+
uses: actions/checkout@v4.2.2
8383

8484
# Setting a VS_VERSION_SUFFIX variable for use by steps that are using solutions specific to VS2019 or VS2022
8585
- name: SetVSVersionSuffix-VS2019

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: Checkout the repo
36-
uses: actions/checkout@v4.1.7
36+
uses: actions/checkout@v4.2.2
3737
with:
3838
fetch-depth: 0
3939

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: 'Checkout the repo'
36-
uses: actions/checkout@v4.1.7
36+
uses: actions/checkout@v4.2.2
3737
with:
3838
fetch-depth: 0
3939

Sharpmake.Generators/FastBuild/Bff.Template.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ public static class ConfigurationFile
355355
+ ' [cmdLineOptions.IgnoreStandardIncludePath]'
356356
+ ' [cmdLineOptions.GeneratePreprocessedFile]'
357357
+ ' [cmdLineOptions.KeepComments]'
358+
+ ' [cmdLineOptions.UseStandardConformingPreprocessor]'
358359
+ ' [cmdLineOptions.StringPooling]'
359360
+ ' [cmdLineOptions.MinimalRebuild]'
360361
+ ' [cmdLineOptions.ExceptionHandling]'

Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,28 @@ private void GenerateCompilerOptions(IGenerationContext context, ProjectOptionsG
695695
Options.Option(Options.Vc.Compiler.KeepComment.Enable, () => { context.Options["KeepComments"] = "true"; context.CommandLineOptions["KeepComments"] = "/C"; })
696696
);
697697

698+
//Options.Vc.Compiler.UseStandardConformingPreprocessor. See: https://learn.microsoft.com/en-us/cpp/build/reference/zc-preprocessor?view=msvc-170
699+
// Disable /Zc:preprocessor-
700+
// Enable /Zc:preprocessor
701+
context.SelectOption
702+
(
703+
Options.Option(Options.Vc.Compiler.UseStandardConformingPreprocessor.Default, () =>
704+
{
705+
context.Options["UseStandardConformingPreprocessor"] = FileGeneratorUtilities.RemoveLineTag;
706+
context.CommandLineOptions["UseStandardConformingPreprocessor"] = FileGeneratorUtilities.RemoveLineTag;
707+
}),
708+
Options.Option(Options.Vc.Compiler.UseStandardConformingPreprocessor.Disable, () =>
709+
{
710+
context.Options["UseStandardConformingPreprocessor"] = "false";
711+
context.CommandLineOptions["UseStandardConformingPreprocessor"] = "/Zc:preprocessor-";
712+
}),
713+
Options.Option(Options.Vc.Compiler.UseStandardConformingPreprocessor.Enable, () =>
714+
{
715+
context.Options["UseStandardConformingPreprocessor"] = "true";
716+
context.CommandLineOptions["UseStandardConformingPreprocessor"] = "/Zc:preprocessor";
717+
})
718+
);
719+
698720
//Options.Vc.Compiler.StringPooling.
699721
// Disable StringPooling="false"
700722
// Enable StringPooling="true" /GF

Sharpmake.Platforms/Sharpmake.CommonPlatforms/BasePlatform.Vcxproj.Template.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public abstract partial class BasePlatform
3535
<PreprocessToFile>[options.GeneratePreprocessedFile]</PreprocessToFile>
3636
<PreprocessSuppressLineNumbers>[options.PreprocessSuppressLineNumbers]</PreprocessSuppressLineNumbers>
3737
<PreprocessKeepComments>[options.KeepComments]</PreprocessKeepComments>
38+
<UseStandardPreprocessor>[options.UseStandardConformingPreprocessor]</UseStandardPreprocessor>
3839
<StringPooling>[options.StringPooling]</StringPooling>
3940
<MinimalRebuild>[options.MinimalRebuild]</MinimalRebuild>
4041
<ExceptionHandling>[options.ExceptionHandling]</ExceptionHandling>

Sharpmake/Options.Vc.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,17 @@ public enum KeepComment
680680
Enable
681681
}
682682

683+
/// <summary>
684+
/// Enables a token-based preprocessor that conforms to C99 and C++11 and later standards.
685+
/// </summary>
686+
public enum UseStandardConformingPreprocessor
687+
{
688+
[Default]
689+
Default,
690+
Disable,
691+
Enable
692+
}
693+
683694
/// <summary>
684695
/// 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.
685696
/// </summary>

Sharpmake/Sharpmake.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
1111
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.11.2177" />
1212
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
13-
<PackageReference Include="Basic.Reference.Assemblies.Net60" Version="1.7.8" />
13+
<PackageReference Include="Basic.Reference.Assemblies.Net60" Version="1.7.9" />
1414
</ItemGroup>
1515

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

0 commit comments

Comments
 (0)