Skip to content

Commit

Permalink
github, use conan2 instead of conan
Browse files Browse the repository at this point in the history
  • Loading branch information
petitlapin committed Oct 20, 2024
1 parent c0be0ae commit 19aae33
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 38 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ jobs:
- name: Install Conan
uses: turtlebrowser/get-conan@main
with:
version: 1.62.0
version: 2.8.1
- name: Configure conan
run: conan profile new default --detect
- name: Update default profile
run: conan profile update settings.compiler.libcxx=libstdc++11 default
run: conan profile detect
- name: Install deps
run: conan install . --install-folder=${{github.workspace}}/build --build=missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True
run: conan install . --output-folder=${{github.workspace}}/build --build=missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True
- name: "Configure and build"
run: cmake -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DUSE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -S . -B build
- name: build
Expand All @@ -37,14 +35,12 @@ jobs:
- name: Install Conan
uses: turtlebrowser/get-conan@main
with:
version: 1.62.0
version: 2.8.1

- name: Configure conan
run: conan profile new default --detect
- name: Update default profile
run: conan profile update settings.compiler.libcxx=libc++ default
run: conan profile detect
- name: Install deps
run: conan install . --install-folder=${{github.workspace}}/build --build=missing
run: conan install . --output-folder=${{github.workspace}}/build --build=missing

- name: "Configure and build"
run: cmake -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DUSE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -S . -B build
Expand All @@ -64,20 +60,21 @@ jobs:
- name: Install Conan
uses: turtlebrowser/get-conan@main
with:
version: 1.62.0
version: 2.8.1

- name: Configure conan
run: conan profile new default --detect
run: conan profile detect
- name: Install deps
run: conan install . --install-folder=${{github.workspace}}/build --build=missing
run: conan install . --output-folder=${{github.workspace}}/build --build=missing
- name: "Configure and build"
run: cmake -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/build/generators/conan_toolchain.cmake -DUSE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -S . -B build
run: cmake -DCMAKE_TOOLCHAIN_FILE="${{github.workspace}}/build/build/generators/conan_toolchain.cmake" -DUSE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -S . -B build

- name: build
run: cmake --build build --config Release
- name: Install NSIS
uses: repolevedavaj/[email protected].1
uses: repolevedavaj/[email protected].2
with:
nsis-version: 3.08
nsis-version: "3.10"
- name: package
run: cmake --build build --config Release --target package
- uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Li-Ri depends on SDL2 and SDL2_mixer (and their dependencies).

Compilation via conan:
=======================
Install conan (version 1 for now, it is not compatible with conan 2 yet as SDL2_mixer is not yet available) and run it: `conan install . --install-folder=build --build=missing`.
Install conan 2 and run it: `conan install . --output-folder=build --build=missing`.

Then, run cmake to generate the build files: `cmake -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DUSE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -S . -B build`.

Expand Down
23 changes: 23 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain

class LiRi(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = "sdl/[~2.28.5]", "sdl_mixer/[~2.8.0]", "openssl/1.1.1w"

def layout(self):
cmake_layout(self)

def configure(self):
self.options["sdl_mixer/*"].mpg123 = False
self.options["sdl_mixer/*"].opus = False
self.options["sdl_mixer/*"].ogg = False
self.options["sdl_mixer/*"].flac = False
self.options["sdl_mixer/*"].mad = False

def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.user_presets_path = 'ConanPresets.json'
tc.generate()
21 changes: 0 additions & 21 deletions conanfile.txt

This file was deleted.

0 comments on commit 19aae33

Please sign in to comment.