Skip to content

Commit

Permalink
🔧 Use conan_provider for running conan
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherFoxGuy committed Dec 23, 2024
1 parent 4748f5e commit 0ee615c
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 107 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/build-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,24 @@ jobs:
curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash
sudo apt-get update
sudo apt-get -y install ninja-build
conan profile detect --force
echo "tools.system.package_manager:mode = install" > ~/.conan2/global.conf
echo "tools.system.package_manager:sudo = True" >> ~/.conan2/global.conf
- name: Install dependencies (Windows)
if: startsWith(matrix.os, 'windows')
shell: cmd
run: git clone https://git.anotherfoxguy.com/AnotherFoxGuy/build-tools.git %BUILD_TOOLS_PATH%

- name: Configure (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
conan profile detect --force
echo "tools.system.package_manager:mode = install" > ~/.conan2/global.conf
echo "tools.system.package_manager:sudo = True" >> ~/.conan2/global.conf
conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f
conan install . -s build_type=Release -b missing -pr:b=default -c tools.cmake.cmaketoolchain:generator="Ninja"
cmake --preset conan-release
shell: bash


- name: Configure (Windows)
if: startsWith(matrix.os, 'windows')
- name: Configure
run: |
conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f
conan install . -b missing -pr:b=tools/conan-profiles/vs-22-release-ninja -pr=tools/conan-profiles/vs-22-release-ninja
cmake --preset conan-release
shell: cmd
cmake . -GNinja -DCMAKE_BUILD_TYPE=Release -Bbuild
- name: Build
run: ninja
run: |
cd build
ninja
- name: Upload bin folder
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v4

- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Release .
run: cmake -DCMAKE_BUILD_TYPE=Release -DUSE_CONAN=OFF .

- name: Build
run: make -j4
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# ensure cmake features we need
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)

option(USE_CONAN "Use Conan to automatically manage dependencies" ON)
if(USE_CONAN)
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan_provider.cmake")
file(DOWNLOAD "https://cdn.statically.io/gh/conan-io/cmake-conan/c22bbf0af0b73d5f0def24a9cdf4ce503ae79e5d/conan_provider.cmake"
"${CMAKE_BINARY_DIR}/conan_provider.cmake"
EXPECTED_HASH SHA256=796E17C1240D7B2167388B9F68411208084A641ED25DF172D64D80EF92F8DA7A
TLS_VERIFY ON)
endif()
list(APPEND CMAKE_PROJECT_TOP_LEVEL_INCLUDES ${CMAKE_BINARY_DIR}/conan_provider.cmake)
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

include(CMakeDependentOption)
Expand Down
8 changes: 0 additions & 8 deletions tools/conan-profiles/vs-19-debug

This file was deleted.

10 changes: 0 additions & 10 deletions tools/conan-profiles/vs-19-debug-ninja

This file was deleted.

8 changes: 0 additions & 8 deletions tools/conan-profiles/vs-19-release

This file was deleted.

10 changes: 0 additions & 10 deletions tools/conan-profiles/vs-19-release-ninja

This file was deleted.

8 changes: 0 additions & 8 deletions tools/conan-profiles/vs-19-relwithdebinfo

This file was deleted.

8 changes: 0 additions & 8 deletions tools/conan-profiles/vs-22-debug

This file was deleted.

10 changes: 0 additions & 10 deletions tools/conan-profiles/vs-22-debug-ninja

This file was deleted.

8 changes: 0 additions & 8 deletions tools/conan-profiles/vs-22-release

This file was deleted.

10 changes: 0 additions & 10 deletions tools/conan-profiles/vs-22-release-ninja

This file was deleted.

8 changes: 0 additions & 8 deletions tools/conan-profiles/vs-22-relwithdebinfo

This file was deleted.

0 comments on commit 0ee615c

Please sign in to comment.