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 02d049b commit 8602cd4
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 100 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build-game.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ jobs:
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 -DCMAKE_INSTALL_PREFIX=redist -DCREATE_CONTENT_FOLDER=ON
cmake . -GNinja -DCMAKE_BUILD_TYPE=Release -Bbuild -DCMAKE_INSTALL_PREFIX=redist -DCREATE_CONTENT_FOLDER=ON
shell: bash

- name: Build
run: ninja install
run: |
cd build
ninja install
shell: bash

- name: Copy *.so files
Expand Down Expand Up @@ -101,17 +102,18 @@ jobs:
path: ~/.conan2

- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
uses: ilammy/msvc-dev-cmd@v1

- 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-19-release-ninja -pr=tools/conan-profiles/vs-19-release-ninja
cmake --preset conan-release -DCMAKE_INSTALL_PREFIX=redist -DCREATE_CONTENT_FOLDER=ON
cmake . -GNinja -DCMAKE_BUILD_TYPE=Release -Bbuild -DCMAKE_INSTALL_PREFIX=redist -DCREATE_CONTENT_FOLDER=ON
shell: cmd

- name: Build
run: ninja install
run: |
cd build
ninja install
shell: cmd

- name: Upload build to itch.io
Expand Down
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.24)

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 ${CMAKE_SOURCE_DIR}/cmake/find-modules)

cmake_policy(SET CMP0127 OLD)
Expand Down
5 changes: 1 addition & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ class RoR(ConanFile):
name = "Rigs of Rods"
settings = "os", "compiler", "build_type", "arch"

def layout(self):
self.folders.generators = os.path.join(self.folders.build, "generators")

def requirements(self):
self.requires("angelscript/2.35.1")
self.requires("discord-rpc/3.4.0@anotherfoxguy/stable")
Expand Down Expand Up @@ -45,6 +42,6 @@ def generate(self):
self.cp_data(f)

def cp_data(self, src):
bindir = os.path.join(self.build_folder, "bin")
bindir = os.path.join(self.build_folder, "libs")
copy(self, "*.dll", src, bindir, False)
copy(self, "*.so*", src, bindir, False)
2 changes: 2 additions & 0 deletions source/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ fast_copy("${CMAKE_SOURCE_DIR}/resources/managed_materials" "${RUNTIME_OUTPUT_DI
fast_copy("${CMAKE_SOURCE_DIR}/resources/fonts" "${RUNTIME_OUTPUT_DIRECTORY}/languages")
fast_copy("${CMAKE_SOURCE_DIR}/languages" "${RUNTIME_OUTPUT_DIRECTORY}/languages")

file(COPY "${CMAKE_BINARY_DIR}/conan/libs/" DESTINATION "${CMAKE_BINARY_DIR}/bin/")


# Install targets
# -----------------------
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 8602cd4

Please sign in to comment.