🔧 Added support for building discord-rpc with conan v2

This commit is contained in:
Edgar 2022-10-21 11:32:50 +02:00
parent bc5a94aa3d
commit c33b6099f1
No known key found for this signature in database
GPG Key ID: 17D930BB616061A5

View File

@ -1,4 +1,6 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.files import get, collect_libs
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout
class DiscordrpcConan(ConanFile):
@ -9,12 +11,19 @@ class DiscordrpcConan(ConanFile):
description = "This is a library for interfacing your game with a locally running Discord desktop client. It's known to work on Windows, macOS, and Linux."
settings = "os", "compiler", "build_type", "arch"
def layout(self):
cmake_layout(self)
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["BUILD_EXAMPLES"] = "OFF"
tc.generate()
def build(self):
cmake = CMake(self)
cmake.definitions['BUILD_EXAMPLES'] = 'OFF'
cmake.configure()
cmake.build()
@ -23,4 +32,4 @@ class DiscordrpcConan(ConanFile):
cmake.install()
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libs = collect_libs(self)