Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Commit af22cfd

Browse files
authored
Fix build error (#153)
1 parent b1c1fae commit af22cfd

6 files changed

Lines changed: 37 additions & 72 deletions

File tree

.github/workflows/bvt-appleclang.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
2121
- name: build and run test with AppleClang
2222
run: |
23-
cmake . -B build
24-
cmake --build ./build -j8
25-
cd ./build
26-
ctest -j8
23+
cmake -B build
24+
cmake --build build -j
25+
ctest --test-dir build -j

.github/workflows/bvt-clang.yml

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ jobs:
2222
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" -y
2323
sudo apt update
2424
sudo apt install -y clang-15 clang-16 clang-17 clang-18
25-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-15 1
26-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-15 1
27-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-16 1
28-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-16 1
29-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-17 1
30-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-17 1
31-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-18 1
32-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-18 1
3325
3426
- name: check compiler versions
3527
run: |
@@ -40,36 +32,24 @@ jobs:
4032
4133
- name: build and run test with clang 15
4234
run: |
43-
sudo update-alternatives --set gcc /usr/bin/clang-15
44-
sudo update-alternatives --set g++ /usr/bin/clang++-15
45-
cmake . -B build-clang-15
46-
cmake --build ./build-clang-15 -j8
47-
cd ./build-clang-15
48-
ctest -j8
35+
cmake -B build-clang-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15
36+
cmake --build build-clang-15 -j
37+
ctest --test-dir build-clang-15 -j
4938
5039
- name: build and run test with clang 16
5140
run: |
52-
sudo update-alternatives --set gcc /usr/bin/clang-16
53-
sudo update-alternatives --set g++ /usr/bin/clang++-16
54-
cmake . -B build-clang-16
55-
cmake --build ./build-clang-16 -j8
56-
cd ./build-clang-16
57-
ctest -j8
41+
cmake -B build-clang-16 -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16
42+
cmake --build build-clang-16 -j
43+
ctest --test-dir build-clang-16 -j
5844
5945
- name: build and run test with clang 17
6046
run: |
61-
sudo update-alternatives --set gcc /usr/bin/clang-17
62-
sudo update-alternatives --set g++ /usr/bin/clang++-17
63-
cmake . -B build-clang-17
64-
cmake --build ./build-clang-17 -j8
65-
cd ./build-clang-17
66-
ctest -j8
47+
cmake -B build-clang-17 -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17
48+
cmake --build build-clang-17 -j
49+
ctest --test-dir build-clang-17 -j
6750
6851
- name: build and run test with clang 18
6952
run: |
70-
sudo update-alternatives --set gcc /usr/bin/clang-18
71-
sudo update-alternatives --set g++ /usr/bin/clang++-18
72-
cmake . -B build-clang-18
73-
cmake --build ./build-clang-18 -j8
74-
cd ./build-clang-18
75-
ctest -j8
53+
cmake -B build-clang-18 -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18
54+
cmake --build build-clang-18 -j
55+
ctest --test-dir build-clang-18 -j

.github/workflows/bvt-gcc.yml

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ jobs:
1818
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
1919
sudo apt update
2020
sudo apt install -y gcc-11 g++-11 gcc-12 g++-12 gcc-13 g++-13
21-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 1
22-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 1
23-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 1
24-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 1
25-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 1
26-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 1
2721
2822
- name: check compiler versions
2923
run: |
@@ -33,27 +27,18 @@ jobs:
3327
3428
- name: build and run test with gcc 11
3529
run: |
36-
sudo update-alternatives --set gcc /usr/bin/gcc-11
37-
sudo update-alternatives --set g++ /usr/bin/g++-11
38-
cmake . -B build-gcc-11
39-
cmake --build ./build-gcc-11 -j8
40-
cd ./build-gcc-11
41-
ctest -j8
30+
cmake -B build-gcc-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11
31+
cmake --build build-gcc-11 -j
32+
ctest --test-dir build-gcc-11 -j
4233
4334
- name: build and run test with gcc 12
4435
run: |
45-
sudo update-alternatives --set gcc /usr/bin/gcc-12
46-
sudo update-alternatives --set g++ /usr/bin/g++-12
47-
cmake . -B build-gcc-12
48-
cmake --build ./build-gcc-12 -j8
49-
cd ./build-gcc-12
50-
ctest -j8
36+
cmake -B build-gcc-12 -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12
37+
cmake --build build-gcc-12 -j
38+
ctest --test-dir build-gcc-12 -j
5139
5240
- name: build and run test with gcc 13
5341
run: |
54-
sudo update-alternatives --set gcc /usr/bin/gcc-13
55-
sudo update-alternatives --set g++ /usr/bin/g++-13
56-
cmake . -B build-gcc-13
57-
cmake --build ./build-gcc-13 -j8
58-
cd ./build-gcc-13
59-
ctest -j8
42+
cmake -B build-gcc-13 -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
43+
cmake --build build-gcc-13 -j
44+
ctest --test-dir build-gcc-13 -j

.github/workflows/bvt-msvc.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ jobs:
1515

1616
- name: build with cmake
1717
run: |
18-
cmake . -B build
19-
cmake --build ./build -j8
18+
cmake -B build
19+
cmake --build build -j
2020
2121
- name: run tests
2222
run: |
23-
cd ./build
24-
ctest -j8
23+
ctest --test-dir build -j

CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required (VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.5)
22

33
project(msft_proxy
44
VERSION 0.1.0 # local build version
@@ -27,11 +27,14 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/proxyConfigVersion.cmake
2727
include(CTest)
2828
if (BUILD_TESTING)
2929
include(FetchContent)
30-
# gtest version release-1.15.2
30+
# The policy uses the download time for timestamp, instead of the timestamp in the archive. This
31+
# allows for proper rebuilds when a projects URL changes.
32+
if(POLICY CMP0135)
33+
cmake_policy(SET CMP0135 NEW)
34+
endif()
3135
FetchContent_Declare(
3236
googletest
33-
URL https://github.com/google/googletest/archive/b514bdc898e2951020cbdca1304b75f5950d1f59.zip
34-
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
37+
URL https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz
3538
)
3639

3740
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) # For Windows: Prevent overriding the parent project's compiler/linker settings

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,9 @@ cmake <source_dir> -B <build_dir> -DCMAKE_TOOLCHAIN_FILE=<vcpkg_dir>/scripts/bui
183183
```
184184
git clone https://github.com/microsoft/proxy.git
185185
cd proxy
186-
cmake -S . -B build
187-
cmake --build ./build -j8
188-
cd ./build
189-
ctest -j8
186+
cmake -B build
187+
cmake --build build -j
188+
ctest --test-dir build -j
190189
```
191190
192191
## Contributing

0 commit comments

Comments
 (0)