-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mark Nefedov
committed
May 7, 2020
1 parent
f65f7e6
commit 831b2ee
Showing
5 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from conans import ConanFile, CMake, tools | ||
|
||
|
||
class VolkConan(ConanFile): | ||
name = "volk" | ||
license = "MIT" | ||
homepage = "https://github.com/zeux/volk" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
description = "volk is a meta-loader for Vulkan. It allows you to \ | ||
dynamically load entrypoints required to use Vulkan without linking\ | ||
to vulkan-1.dll or statically linking Vulkan loader. Additionally,\ | ||
volk simplifies the use of Vulkan extensions by automatically\ | ||
loading all associated entrypoints. Finally, volk enables\ | ||
loading Vulkan entrypoints directly from the driver which \ | ||
can increase performance by skipping loader dispatch \ | ||
overhead." | ||
topics = ("Vulkan", "graphics") | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake" | ||
no_copy_source = True | ||
|
||
def source(self): | ||
self.run("git clone https://github.com/zeux/volk.git") | ||
self.run("cd volk/ && git checkout %s" % self.version) | ||
|
||
def package(self): | ||
self.copy("*volk.h", dst="include") | ||
self.copy("*volk.c", dst="include") | ||
self.copy("*LICENSE.md", dst="licenses") | ||
|
||
def package_info(self): | ||
if self.settings.os == "Linux": | ||
self.cpp_info.libs.extend(["dl"]) | ||
|
||
def package_id(self): | ||
self.info.header_only() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
project(PackageTest CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
add_executable(example example.cpp) | ||
target_link_libraries(example ${CONAN_LIBS}) | ||
|
||
# CTest is a testing tool that can be used to test your project. | ||
# enable_testing() | ||
# add_test(NAME example | ||
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin | ||
# COMMAND example) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
|
||
from conans import ConanFile, CMake, tools | ||
|
||
|
||
class VolkTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is | ||
# in "test_package" | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self.settings): | ||
os.chdir("bin") | ||
self.run(".%sexample" % os.sep) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <iostream> | ||
#define VOLK_IMPLEMENTATION | ||
#include <volk/volk.h> | ||
|
||
int main() { | ||
/* Try to initialize volk. This might not work on CI builds, | ||
* but should have compiled at least. */ | ||
VkResult r = volkInitialize(); | ||
uint32_t version = volkGetInstanceVersion(); | ||
printf("Vulkan version %d.%d.%d initialized.\n", | ||
VK_VERSION_MAJOR(version), | ||
VK_VERSION_MINOR(version), | ||
VK_VERSION_PATCH(version) | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
"ed4c168595bc7c5d36925f0036ea14d36b20c87c": | ||
folder: all |