Skip to content

Commit a7216aa

Browse files
authored
Use stdcpplatest until all tooling have been upgraded (#77)
* Use stdcpplatest until all tooling (MSVC on CI and Sonar) have been upgraded At the moment stdcpplatest is the same as stdcpp23. Use stdcpplatest until Sonar can also handle it. * Update sonar settings
1 parent 1bc1094 commit a7216aa

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

.github/workflows/build.yml .github/workflows/sonarcloud-analysis.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,22 @@ jobs:
2424
- name: Set up msbuild
2525
uses: microsoft/setup-msbuild@v2
2626

27-
- name: Install sonar-scanner and build-wrapper
28-
uses: SonarSource/sonarcloud-github-c-cpp@v3
27+
- name: Install Build Wrapper
28+
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v5
2929

3030
- name: Restore NuGet packages
31-
working-directory: ${{env.GITHUB_WORKSPACE}}
32-
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
31+
working-directory: ${{ env.GITHUB_WORKSPACE }}
32+
run: nuget restore ${{ env.SOLUTION_FILE_PATH }}
3333

3434
- name: Run build-wrapper
3535
run: |
3636
build-wrapper-win-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} msbuild jpegls-wic-codec.sln /t:jpegls-wic-codec:rebuild /p:Configuration="Release" /p:Platform="x64" /nodeReuse:false
3737
38-
- name: Run sonar-scanner
38+
- name: SonarQube Scan
39+
uses: SonarSource/sonarqube-scan-action@v5
3940
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here
42-
run: |
43-
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
41+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42+
with:
43+
# Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
44+
args: >
45+
--define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"

Directory.Build.props

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--
1+
<!--
22
SPDX-FileCopyrightText: © 2019 Team CharLS
33
SPDX-License-Identifier: BSD-3-Clause
44
-->
@@ -47,8 +47,8 @@
4747
<MultiProcessorCompilation>true</MultiProcessorCompilation>
4848

4949
<!-- Explicit define that all projects are compiled according the draft C++23 standard -->
50-
<LanguageStandard>stdcpp23</LanguageStandard>
51-
<UseStandardPreprocessor>true</UseStandardPreprocessor> <!-- Needed as stdcpp20 doesn't enable it by default. -->
50+
<LanguageStandard>stdcpplatest</LanguageStandard>
51+
<UseStandardPreprocessor>true</UseStandardPreprocessor> <!-- Needed as stdcpplatest doesn't enable it by default. -->
5252

5353
<!-- To ensure high quality C++ code use Warning level 4 and treat warnings as errors to ensure warnings are fixed promptly. -->
5454
<WarningLevel>Level4</WarningLevel>
@@ -179,8 +179,6 @@
179179
<PropertyGroup Condition="'$(Configuration)'=='Release'">
180180
<UseDebugLibraries>false</UseDebugLibraries>
181181
<LinkIncremental>false</LinkIncremental>
182-
<WholeProgramOptimization>true</WholeProgramOptimization>
183-
184182
<RunCodeAnalysis>true</RunCodeAnalysis>
185183
<EnableCppCoreCheck>true</EnableCppCoreCheck>
186184
<EnableMicrosoftCodeAnalysis>true</EnableMicrosoftCodeAnalysis>
@@ -198,6 +196,10 @@
198196
<UseFullPaths>false</UseFullPaths>
199197
<FunctionLevelLinking>true</FunctionLevelLinking>
200198
<IntrinsicFunctions>true</IntrinsicFunctions>
199+
<WholeProgramOptimization>true</WholeProgramOptimization>
200+
201+
<!-- Enable Optimize Global Data (/Gw). off by default -->
202+
<AdditionalOptions>/Gw /Zc:checkGwOdr %(AdditionalOptions)</AdditionalOptions>
201203
</ClCompile>
202204
<Link>
203205
<EnableCOMDATFolding>true</EnableCOMDATFolding>

sonar-project.properties

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) Team CharLS.
1+
# SPDX-FileCopyrightText: © 2023 Team CharLS
22
# SPDX-License-Identifier: BSD-3-Clause
33

44
sonar.projectKey = team-charls_jpegls-wic-codec
@@ -13,4 +13,6 @@ sonar.sources = src/
1313
sonar.tests = test/
1414

1515
# Encoding of the source code files. Default is the default system encoding, which is correct.
16-
sonar.sourceEncoding=UTF-8
16+
sonar.sourceEncoding = UTF-8
17+
18+
sonar.cfamily.enableModules = true

0 commit comments

Comments
 (0)