Skip to content

Commit d321bd4

Browse files
authored
Fix a conan issue in github actions (drogonframework#1517)
1 parent 313392a commit d321bd4

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

.github/workflows/cmake.yml

+14-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
jobs:
1414
windows:
1515
name: windows/msvc - ${{ matrix.link }}
16-
runs-on: windows-latest
16+
runs-on: windows-2019
1717
strategy:
1818
fail-fast: false
1919
matrix:
@@ -33,21 +33,25 @@ jobs:
3333

3434
- name: Install conan packages
3535
working-directory: ./build
36-
run: conan install .. -s compiler="Visual Studio" -s compiler.version=16 -sbuild_type=Debug -g cmake_paths
36+
run: |
37+
conan profile detect
38+
conan install .. -s compiler="msvc" -sbuild_type=Debug --build=missing -s compiler.cppstd=17
3739
3840
- name: Create Build Environment & Configure Cmake
3941
shell: bash
4042
working-directory: ./build
4143
run: |
4244
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
43-
cmake .. \
44-
-DCMAKE_BUILD_TYPE=Debug \
45-
-DBUILD_TESTING=on \
46-
-DBUILD_SHARED_LIBS=$shared \
47-
-DCMAKE_TOOLCHAIN_FILE="conan_paths.cmake" \
48-
-DBUILD_CTL=ON \
49-
-DBUILD_EXAMPLES=ON \
50-
-DCMAKE_INSTALL_PREFIX=../install
45+
cmake .. \
46+
-DCMAKE_BUILD_TYPE=Debug \
47+
-DBUILD_TESTING=on \
48+
-DBUILD_SHARED_LIBS=$shared \
49+
-DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" \
50+
-DBUILD_CTL=ON \
51+
-DBUILD_EXAMPLES=ON \
52+
-DCMAKE_INSTALL_PREFIX=../install \
53+
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
54+
-DCMAKE_CXX_STANDARD=17
5155
5256
- name: Build
5357
run: cmake --build build --target install --parallel

conanfile.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
jsoncpp/1.9.4
33
zlib/1.2.11
44
gtest/1.10.0
5-
sqlite3/3.34.1
5+
sqlite3/3.40.1
66
#libpq/13.2
7-
openssl/1.1.1j
7+
openssl/1.1.1t
88
hiredis/1.0.0
99
brotli/1.0.9
1010

1111
[generators]
12-
cmake_paths
12+
CMakeToolchain
1313

1414
[options]
1515

test.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ echo "Hello, world!" >>hello.csp
132132

133133
cd ../build
134134
if [ $os = "windows" ]; then
135-
conan install $src_dir -s compiler="Visual Studio" -s compiler.version=16 -sbuild_type=Debug -g cmake_paths
136-
cmake_gen="$cmake_gen -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake -DCMAKE_INSTALL_PREFIX=$src_dir/install"
135+
cmake_gen="$cmake_gen -DCMAKE_TOOLCHAIN_FILE=$src_dir/conan_toolchain.cmake \
136+
-DCMAKE_PREFIX_PATH=$src_dir/install \
137+
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
138+
-DCMAKE_CXX_STANDARD=17"
137139
fi
138140
cmake .. $cmake_gen
139141

0 commit comments

Comments
 (0)