From d321bd4fc18928cc27dca4979fdd31b51e8dd322 Mon Sep 17 00:00:00 2001 From: An Tao Date: Mon, 27 Feb 2023 14:30:38 +0800 Subject: [PATCH] Fix a conan issue in github actions (#1517) --- .github/workflows/cmake.yml | 24 ++++++++++++++---------- conanfile.txt | 6 +++--- test.sh | 6 ++++-- trantor | 2 +- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 04a018a7..7464b71d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -13,7 +13,7 @@ env: jobs: windows: name: windows/msvc - ${{ matrix.link }} - runs-on: windows-latest + runs-on: windows-2019 strategy: fail-fast: false matrix: @@ -33,21 +33,25 @@ jobs: - name: Install conan packages working-directory: ./build - run: conan install .. -s compiler="Visual Studio" -s compiler.version=16 -sbuild_type=Debug -g cmake_paths + run: | + conan profile detect + conan install .. -s compiler="msvc" -sbuild_type=Debug --build=missing -s compiler.cppstd=17 - name: Create Build Environment & Configure Cmake shell: bash working-directory: ./build run: | [[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF" - cmake .. \ - -DCMAKE_BUILD_TYPE=Debug \ - -DBUILD_TESTING=on \ - -DBUILD_SHARED_LIBS=$shared \ - -DCMAKE_TOOLCHAIN_FILE="conan_paths.cmake" \ - -DBUILD_CTL=ON \ - -DBUILD_EXAMPLES=ON \ - -DCMAKE_INSTALL_PREFIX=../install + cmake .. \ + -DCMAKE_BUILD_TYPE=Debug \ + -DBUILD_TESTING=on \ + -DBUILD_SHARED_LIBS=$shared \ + -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" \ + -DBUILD_CTL=ON \ + -DBUILD_EXAMPLES=ON \ + -DCMAKE_INSTALL_PREFIX=../install \ + -DCMAKE_POLICY_DEFAULT_CMP0091=NEW \ + -DCMAKE_CXX_STANDARD=17 - name: Build run: cmake --build build --target install --parallel diff --git a/conanfile.txt b/conanfile.txt index bc86da8b..ca6b4936 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -2,14 +2,14 @@ jsoncpp/1.9.4 zlib/1.2.11 gtest/1.10.0 -sqlite3/3.34.1 +sqlite3/3.40.1 #libpq/13.2 -openssl/1.1.1j +openssl/1.1.1t hiredis/1.0.0 brotli/1.0.9 [generators] -cmake_paths +CMakeToolchain [options] diff --git a/test.sh b/test.sh index d78dc1d1..e16184b3 100755 --- a/test.sh +++ b/test.sh @@ -132,8 +132,10 @@ echo "Hello, world!" >>hello.csp cd ../build if [ $os = "windows" ]; then - conan install $src_dir -s compiler="Visual Studio" -s compiler.version=16 -sbuild_type=Debug -g cmake_paths - cmake_gen="$cmake_gen -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake -DCMAKE_INSTALL_PREFIX=$src_dir/install" + cmake_gen="$cmake_gen -DCMAKE_TOOLCHAIN_FILE=$src_dir/conan_toolchain.cmake \ + -DCMAKE_PREFIX_PATH=$src_dir/install \ + -DCMAKE_POLICY_DEFAULT_CMP0091=NEW \ + -DCMAKE_CXX_STANDARD=17" fi cmake .. $cmake_gen diff --git a/trantor b/trantor index 41fa158c..b7ae847d 160000 --- a/trantor +++ b/trantor @@ -1 +1 @@ -Subproject commit 41fa158cae1c015bde3c52bc485c363d54a501b2 +Subproject commit b7ae847d5a7adba0e03b3aa232fc91c8f66c3be3