From d1473bfde7f4206ef76647d1c20f1676c6d1b64c Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 29 Apr 2021 11:24:52 +0200 Subject: [PATCH] ci: fixed setting Ninja as a default generator for Conan --- .github/workflows/ci-test-package-cmake.yml | 1 + .github/workflows/codeql-analysis.yml | 2 ++ .github/workflows/documentation.yml | 1 + conanfile.py | 2 +- docs/usage.rst | 1 - 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-test-package-cmake.yml b/.github/workflows/ci-test-package-cmake.yml index ea9f6696..69b7f06f 100644 --- a/.github/workflows/ci-test-package-cmake.yml +++ b/.github/workflows/ci-test-package-cmake.yml @@ -84,6 +84,7 @@ jobs: CC: ${{ matrix.config.compiler.cc }} CXX: ${{ matrix.config.compiler.cxx }} CMAKE_GENERATOR: Ninja + CONAN_CMAKE_GENERATOR: Ninja steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 478d0435..0e3c43f6 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -80,6 +80,8 @@ jobs: python-version: '3.8' - name: Conan build if: matrix.language == 'cpp' + env: + CONAN_CMAKE_GENERATOR: Ninja run: | pip install -U conan conan config init diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 1229e983..fdefe755 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -40,6 +40,7 @@ env: CC: gcc-10 CXX: g++-10 CMAKE_GENERATOR: Ninja + CONAN_CMAKE_GENERATOR: Ninja jobs: docs: diff --git a/conanfile.py b/conanfile.py index 832ed641..d3d37125 100644 --- a/conanfile.py +++ b/conanfile.py @@ -102,7 +102,7 @@ class UnitsConan(ConanFile): # del self.options.build_docs def generate(self): - tc = CMakeToolchain(self) + tc = CMakeToolchain(self, generator=os.getenv("CONAN_CMAKE_GENERATOR")) tc.variables["UNITS_DOWNCAST_MODE"] = str(self.options.downcast_mode).upper() # if self._run_tests: # TODO Enable this when environment is supported in the Conan toolchain tc.variables["UNITS_BUILD_DOCS"] = self.options.build_docs diff --git a/docs/usage.rst b/docs/usage.rst index e074f941..24fe91ca 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -92,7 +92,6 @@ in *~/.conan/profiles* directory. An example profile can look as follows: [env] CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 - CONAN_CMAKE_GENERATOR=Ninja .. tip::