mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
56992b099e
* Don't overwrite the CMAKE_MODULE_PATH * Allow linking libsodium statically with MSVC * Allow finding libsodium the normal way on MSVC * Allow using pthreads4w for pthreads on MSVC * Fall back to find_package if pkg_find_module fails * Don't pass incompatible compile flags to MSVC * Also try to find Opus and libvpx using their canonical names * Support building using conan * Allow pkg_use_module to take a list of libraries to look for * Build for Windows on Appveyor using conan
34 lines
990 B
Python
34 lines
990 B
Python
# pylint: disable=not-callable
|
|
from conans import CMake
|
|
from conans import ConanFile
|
|
|
|
|
|
class ToxConan(ConanFile):
|
|
settings = "os", "compiler", "build_type", "arch"
|
|
requires = "libsodium/1.0.18", "opus/1.3.1", "libvpx/1.8.0@bincrafters/stable"
|
|
generators = "cmake_find_package"
|
|
|
|
def requirements(self):
|
|
if self.settings.os == "Windows":
|
|
self.requires("pthreads4w/3.0.0")
|
|
|
|
def source(self):
|
|
self.run("git clone https://github.com/toktok/c-toxcore.git")
|
|
|
|
def build(self):
|
|
cmake = CMake(self)
|
|
cmake.definitions["AUTOTEST"] = True
|
|
cmake.definitions["BUILD_MISC_TESTS"] = True
|
|
cmake.definitions["MUST_BUILD_TOXAV"] = True
|
|
if self.settings.compiler == "Visual Studio":
|
|
cmake.definitions["MSVC_STATIC_SODIUM"] = True
|
|
|
|
if self.should_configure:
|
|
cmake.configure()
|
|
|
|
if self.should_build:
|
|
cmake.build()
|
|
|
|
if self.should_test:
|
|
cmake.test()
|