Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: C/C++ CI on Windows (vs2019)
name: C/C++ CI on Windows (vs2022)

on:
push:
Expand All @@ -16,7 +16,7 @@ on:
jobs:
build:

runs-on: windows-2019
runs-on: windows-2022
name: Build

steps:
Expand All @@ -29,7 +29,7 @@ jobs:
env:
SKIP_ARM_BUILD: 1
SKIP_ARM64_BUILD: 1
PlatformToolset: v142
VSTOOLS_VERSION: vs2019
PlatformToolset: v143
VSTOOLS_VERSION: vs2022
shell: cmd
run: build-all.bat
17 changes: 8 additions & 9 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: windows-2019
runs-on: windows-2022
permissions:
contents: read
actions: read
Expand All @@ -28,7 +28,7 @@ jobs:
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp', 'csharp', 'javascript', 'python']
language: ['cpp', 'javascript', 'python']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

Expand All @@ -47,18 +47,17 @@ jobs:
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# Autobuild attempts to build any compiled languages (C/C++, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v3
- name: Build
- name: Build C++
env:
SKIP_ARM_BUILD: 1
SKIP_ARM64_BUILD: 1
PlatformToolset: v142
VSTOOLS_VERSION: vs2019
PlatformToolset: v143
VSTOOLS_VERSION: vs2022
WindowsSDKVersion: 10.0.22621.0
shell: cmd
if: matrix.language == 'cpp' || matrix.language == 'csharp'
if: matrix.language == 'cpp'
run: build-all.bat

# ℹ️ Command-line programs to run using the OS shell.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-win-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
matrix:
arch: [Win32, x64]
build: [Release, Debug]
os: [windows-2019]
os: [windows-2022]

steps:

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Other resources to learn how to setup the build system:
| Ubuntu 18.04 LTS | GCC 7.5.x |
| Windows 10 | Android Studio/Gradle |
| Windows Server 2016 | Visual Studio 2017 (vc141) |
| Windows Server 2019 | Visual Studio 2019 (vc142) |
| Windows Server 2022 | Visual Studio 2022 (vc143) |

## Target Platforms

Expand All @@ -96,7 +96,8 @@ Other resources to learn how to setup the build system:
| Windows 10.x | :white_check_mark: | |
| Windows Server 2012 | :white_check_mark: | |
| Windows Server 2016 | :white_check_mark: | |
| Windows Server 2019 | :white_check_mark: | :white_check_mark: |
| Windows Server 2019 | :white_check_mark: | |
| Windows Server 2022 | :white_check_mark: | :white_check_mark: |

* **Supported** - these platforms are known to work well with the SDK in
production.
Expand Down
81 changes: 81 additions & 0 deletions build-cmake-clang-vs2022.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@echo off

set VSTOOLS_VERSION=vs2022
cd %~dp0

echo Update all public submodules...
git -c submodule."lib/modules".update=none submodule update --init --recursive

if DEFINED GIT_PULL_TOKEN (
rd /s /q lib\modules
git clone https://%GIT_PULL_TOKEN%:x-oauth-basic@github.com/microsoft/cpp_client_telemetry_modules.git lib\modules
)

call tools\vcvars.cmd

setlocal enableextensions
setlocal enabledelayedexpansion
set ROOT=%~dp0

REM ********************************************************************
REM Use cmake
REM ********************************************************************
set "PATH=C:\Program Files\CMake\bin\;%PATH%"

REM ********************************************************************
REM Use clang compiler
REM ********************************************************************
set CLANG_PATH="C:\Program Files\LLVM\bin"
set CC=%CLANG_PATH%\clang.exe
set CXX=%CLANG_PATH%\clang++.exe
set LLVM_VER=ClangCL

REM ********************************************************************
REM Set output directory, clean and/or create as-needed
REM ********************************************************************
set OUTDIR=%ROOT%\Solutions\out
if "%1" == "clean" (
@rmdir /s /q %OUTDIR%
)
if not exist "%OUTDIR%" mkdir %OUTDIR%

REM ********************************************************************
REM Build all deps using MSVC - Visual Studio 2022 (17)
REM ********************************************************************
if "%1" == "nodeps" goto NODEPS
call tools\build-deps.cmd
:NODEPS

cd %OUTDIR%

REM ********************************************************************
REM Invoke the build script
REM ********************************************************************
set CMAKE_PACKAGE_TYPE=tgz
for %%a in ( m32 m64 ) do (
for %%c in ( Release ) do (
if "%%a"=="m32" (
set ARCH=Win32
set ARCH_GEN= Win32
)
if "%%a"=="m64" (
set ARCH=x64
set ARCH_GEN= x64
)
@mkdir %OUTDIR%\%%c\!ARCH!
cd %OUTDIR%\%%c\!ARCH!
set "CFLAGS=-%%a"
set "CXXFLAGS=-%%a -Wc++11-compat-pedantic -Wno-c++98-compat -Wno-everything"
cmake -G"Visual Studio 17 2022" -A !ARCH_GEN! ^
-T"%LLVM_VER%" ^
-DTARGET_ARCH=!ARCH! ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=%%c ^
-DCMAKE_PACKAGE_TYPE=%CMAKE_PACKAGE_TYPE% ^
-DDEFAULT_PAL_IMPLEMENTATION=WIN32 ^
%ROOT%
cmake --build . --config %%c -- /p:Configuration=%%c
)
)

cd %ROOT%
8 changes: 4 additions & 4 deletions docs/cpp-start-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If your project requires the Universal Telemetry Client (a.k.a. UTC) to send tel

## **Windows prerequisites and dependencies for building from source**

* Visual Studio 2017 or 2019 (2019 is recommended).
* Visual Studio 2019 or 2022 (2022 is recommended).
* C++ Dev Tools

## **Option 1: Build the SDK from source using Visual Studio**
Expand Down Expand Up @@ -58,11 +58,11 @@ Make sure you can build a simple "Hello World" using CMake before proceeding to

To build SDK using cmake with clang on Windows, run:

```build-cmake-clang-vs2017.cmd```
```build-cmake-clang-vs2019.cmd```

or

```build-cmake-clang-vs2019.cmd```
```build-cmake-clang-vs2022.cmd```

depending on what Visual Studio version you are using.

Expand Down Expand Up @@ -113,6 +113,6 @@ More examples can be found under *examples* folder.
- [CMake Tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html)
- [Runtime Library Variants: static vs dynamic runtime](https://www.oreilly.com/library/view/c-cookbook/0596007612/ch01s24.html)

If you encounter troubles building the project, please refer to our CI/Build pipeline settings [here](../.github/workflows/build-windows-vs2019.yaml). This pipeline runs on a standard GitHub image with a standard Visual Studio 2019 installation. If you are still stuck, please log your build question as [GitHub issue](https://github.com/microsoft/cpp_client_telemetry/issues) with labels `question` and `build infra`. We would be glad to help and adjust documentation accordingly.
If you encounter troubles building the project, please refer to our CI/Build pipeline settings [here](../.github/workflows/build-windows-vs2022.yaml). This pipeline runs on a standard GitHub image with a standard Visual Studio 2022 installation. If you are still stuck, please log your build question as [GitHub issue](https://github.com/microsoft/cpp_client_telemetry/issues) with labels `question` and `build infra`. We would be glad to help and adjust documentation accordingly.

If you find that some documentation is incorrect, please send a PR to fix it. We ❤️ community contributions!
Loading